如何将 IPAddress 传递给 webBrowser 控件
这是我的代码,但我不知道如何将 ip-address 传递给 webBrowser 控件。
IPHostEntry host;
string localIP = "?";
host = Dns.GetHostEntry(Dns.GetHostName());
foreach (string line in File.ReadAllLines("proxy.txt"))
{
IPAddress ip = IPAddress.Parse(line);
if (ip.AddressFamily.ToString() == "InterNetwork")
{
localIP = ip.ToString();
textBox1.Text = ip.ToString();
// This code doesn't work, it's just a hypothetical example:
webBrowser1.SourceIPAddress=ip;
webBrowser1.Navigate(textBox2.Text);
}
}
这就是我想将 ip 地址传递给 webBrowser 控件的方式
//The code doesn't work, it's just a hypothetical example:
webBrowser1.SourceIPAddress = ip;