十分急切需要大神帮忙指教一下,再次感谢了


string url = report_addr +$"thirdApi/saveHealthExamPile":

NameValueCollection nvc = new NameValueCollection ();
nve.Add("param,“{\“idNo\ :\  + sfzh + “\’,\"examDate\":\"" + tjb. Jdrq. Value. ToString("yyyy-M-dd) + "\, \"type\":\"5\}"):
var task = uploadGXTJ(lt.nvc,ms. ToArray(),url,partner_license):


async
Task<qmResult>
uploadGXTJ
LoginToken
lt.
NameValueCollection formData,
byte[]
file.
string url,
string partner_license)
try
using(HttpClient webClient = new HttpClient())
// 添加表单数据
//webClient.Headers.Add("Content-Type","multipart/form-data");
webClient. DefaultRequestHeaders.AcceptEncoding. Add(new StringWithQualityHeaderValue("utf-8"));
webClient. DefaultRequestHeaders.Add("access_token", lt.access_token);
webClient. DefaultRequestHeaders.Add("partner-license", partner_license);
using (var mformData = new MultipartFormDataContent ()
var fileContent = new StreamContent(new MemoryStream(file));
fileContent.Headers.ContentType = MediaTypeHeaderValue. Parse("multipart/form-data");
mformData.Add(fileContent,“file", Path.GetFileName("mn.jpg"));
foreach (var key in formData.AllKeys)
var keyValueContent = new StringContent(formData[key]):

mformData.Add (keyValueContent, key): // 替换为你的表单键名

  重点是在;{"param":[{"idNo":"152701195712084815","examDate":"2022-01-06","type":"1"}],
         "file":图像的字符串}
 请教一下这个写法对吗?写两行怎样结合的?报文内容怎样处理?第二行应该写还是不应该写?如果写用什么格式?