111,129
社区成员
发帖
与我相关
我的任务
分享
[/quote]

class MesDLL
{
[DllImport("MESScan.dll",EntryPoint="PostDataA")]
public static extern bool PostDataA(string url, ref string rst, int length);
}
string str="" ;
string val = "SFC=" + SFC + "&SITE=" + SITE + "&PLATFORM=" + PLATFORM + "&RESOURCE=" + RESOURCE + "&OPERATION=" + OPERATION + "&PULSE_FREQ=" + PULSE_FREQ +
"&PULSE_WIDTH=" + PULSE_WIDTH + "&INT_L=" + INT_L + "&INT_M=" + INT_M + "&INT_H=" + INT_H + "&PULSE_TD_C=" + PULSE_TD_C + "&PULSE_TD_I=" + PULSE_TD_I +
"&NCCODE=" + NCCODE + "&TESTRESULT=" + TESTRESULT;
bool bl = MesDLL.PostDataA(val, ref str, 10);
MessageBox.Show(str);
上面代码是按eg3调用,执行结果是bl返回false.返回值str乱码。调整iMaxRstLen为空。