首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

请教,c# 中有没有类似于InternetOpen之类的函数,小弟我要通过http验证

2012-01-19 
请问,c# 中有没有类似于InternetOpen之类的函数,我要通过http验证。在vc中可以如此:#includeWininet.h#pr

请问,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);

热点排行