此代码在 Win7 上运行良好,但0x2f8c
在 Windows 8(发布预览版)中因未知错误而失败。知道为什么吗?请注意,我检查了代码,编译并运行了它,但我很确定我得到了所有依赖项。win32 声明:
[DllImport("wininet.dll", CharSet = CharSet.Auto, SetLastError = true)]
extern public static IntPtr InternetConnect(
[In] IntPtr hInternet,
[In] string serverName,
[In] int serverPort,
[In] string userName,
[In] string password,
[In] int dwService,
[In] int dwFlags,
[In] IntPtr dwContext);