VB中webbrowser控件使用SOCKS5袋里
让webbrowser控件通过SOCKS5袋里(有认证)来浏览网页
Private Const INTERNET_OPTION_PROXY = 38
Private Const INTERNET_OPEN_TYPE_PROXY = 3
Private Type INTERNET_PROXY_INFO
dwAccessType As Long
lpszProxy As String
lpszProxyBypass As String
End Type
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
Function SetProxy()
Dim options As INTERNET_PROXY_INFO
options.dwAccessType = INTERNET_OPEN_TYPE_PROXY
options.lpszProxy = "SOCKS=127.0.0.1:9050"
options.lpszProxyBypass = ""
internetsetoption 0, INTERNET_OPTION_PROXY, options, LenB(options)
End Function
link
评论