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

eXtplorer - 一个基于PHP和JavaScript的在线文件管理器

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

mihomo各平台客户端下载(windows, android, macos)

常用的国内外延迟测速链接(generate_204)

Win10和Win11家庭版开启远程桌面功能RDP

坚持跑步到底有哪些改变?

十二国记 (2002)

优化PC端B站(Bilibili)免登录观看体验

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