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

随身WiFi折腾指南: 解锁、刷机与DIY

Cromite - 极度注重隐私的Chromium浏览器

《赤い涙 》灼眼的夏娜剧场版插曲

求职面试时常被问到的65个问题与技巧性回答

伤不起的盖茨比——那些年,我们没逆袭到的女神

人类的十个有趣心理效应

电话销售技巧8:如何绕过前台

Alexa互联网信息公司中文官方网站

拒绝道德绑架,这才是真正的公益广告

感情的瓶颈期或者说磨合期该怎么度过?