如何在 C# webbrowser 中使用套接字代理? [英] How do I use a socket proxy in C# webbrowser?

查看:21
本文介绍了如何在 C# webbrowser 中使用套接字代理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

How do I point a socket to the proxy ip/port using the winforms webbrowser control? The standard web browser that comes with Visual C#.NET.

请在 Visual C#.NET 方面提供帮助.

Please help in Visual C#.NET.

推荐答案

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

The WebBrowser control is just a wrapper around IE. So to set proxy settings, you could change the registry key entries.

像这样:

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

var key = Registry.CurrentUser.OpenSubKey(@"SoftwareMicrosoftWindowsCurrentVersionInternet Settings", true);
key.SetValue("ProxyServer", serverName + ":" + port);
key.SetValue("ProxyEnable", 1);

这篇关于如何在 C# webbrowser 中使用套接字代理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆