[C#] 纯文本查看 复制代码
[DllImport("wininet.dll", SetLastError = true, CharSet = CharSet.Auto, CallingConvention = CallingConvention.Cdecl)]
public static extern bool HttpSendRequest(IntPtr hRequest, string szHeaders, long headersLen, IntPtr options, long optionsLen);
//以上初始化正常,就是在HttpSendRequest时报错:对 PInvoke 函数“ome.Wininet::HttpSendRequest”的调用导致堆栈不对称。原因可能是托管///的 PInvoke 签名与非托管的目标签名不匹配。请检查 PInvoke 签名的调用约定和参数与非托管的目标签名是否匹配。
string HEADER = "Content-Type: application/x-www-form-urlencoded\r\n";
int HEADLEN =HEADER.Length;
bool nRetsult = HttpSendRequest(hRequest, HEADER, HEADLEN, (IntPtr)0, 0);
麻烦站长指教一下,谢谢!
|