gpt4 book ai didi

c# - 如何在 C# webbrowser 中使用套接字代理?

转载 作者:太空狗 更新时间:2023-10-30 01:09:40 26 4
gpt4 key购买 nike

如何使用 winforms webbrowser 控件将套接字指向代理 ip/端口? Visual C#.NET 附带的标准 Web 浏览器。

请在 Visual C#.NET 中提供帮助。

最佳答案

WebBrowser 控件只是 IE 的包装器。因此,要设置代理设置,您可以更改注册表项。

像这样:

string serverName = ""; // your proxy server name
string port = ""; // your proxy port

var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings", true);
key.SetValue("ProxyServer", serverName + ":" + port);
key.SetValue("ProxyEnable", 1);

关于c# - 如何在 C# webbrowser 中使用套接字代理?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6246498/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com