日期:2014-05-18  浏览次数:20801 次

请问,c# 中有没有类似于InternetOpen之类的函数,我要通过http验证。
在vc中可以如此:
#include <Wininet.h>  
  #pragma comment(lib,"Wininet")  

但是c#中不知道怎么搞。
c# 中有没有类似于InternetOpen之类的函数,我要通过http验证。

------解决方案--------------------
这是一个API函数,需要引入一个特殊的dll WinInet
声明方式:
[DllImport("wininet.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern IntPtr InternetOpen(string sAgent, int iAccessType, string sProxyName, string sProxyBypass, int iFlags);