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

评论

Popular Posts

如何提高情商(EQ)

地方门户网站项目可行性分析

快乐来自于做出「舍弃」的能力

2009年即将流行的牛逼语录:经典的我都无语了(转载)

小清新必须死

SolveigMM Video Splitter - 无损视频编辑工具(视频剪辑,合并等)

《挪威的森林》精彩篇章:永远记得我

不要再Best Regards了!英文Email四大问题

聪明处事72招

没有灵魂,只有交易——为何“苹果”会杀人