dwAccessTypeAs Long
lpszProxy As String
lpszProxyBypass As String
End Type
Private Const INTERNET_OPEN_TYPE_PROXY = 3
Private Const INTERNET_OPTION_PROXY = 38
Private Const INTERNET_OPTION_SETTINGS_CHANGED = 39
Private Declare Function internetsetoption Lib "WinInet.dll" Alias "InternetSetOptionA" (ByVal hinternet As Long, ByVal dwoption As Long, ByRef lpBuffer As Any, ByVal dwbufferlength As Long) As Long
Dim options As INTERNET_PROXY_INFO
options.dwAccessType = INTERNET_OPEN_TYPE_PROXY
options.lpszProxy = "SOCKS=IP:端口" '如果是http代理就是HTTP=IP:端口
options.lpszProxyBypass = ""
internetsetoption 0, INTERNET_OPTION_PROXY, options, LenB(options)
internetsetoption 0, INTERNET_OPTION_SETTINGS_CHANGED, 0, 0
1)继承
public class MyGeckoWebBrowser : GeckoWebBrowser{
//重载原来的OnPaint
protected override void OnPrint(PaintEventArgs e)
{
base.OnPaint(e)
//在此添加你需要的处理代码
……
}
}
2)在Form1中
MyGeckoWebBrowser _browse=new MyGeckoWebBrowser()form1.controls.add( _browse)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)