由网友(满城阳光不及她)分享简介:如何通过ip地址为web浏览器控件这是我的code,但我不知道如何通过IP地址来WebBrowser控件。IPHostEntry主机;字符串localIP =?;主机= Dns.GetHostEntry(Dns.GetHostName());的foreach(在File.ReadAllLines串行(proxy....![VB使用webbrowser控件访问网页](https://p.xsw88.cn/allimgs/daicuo/20230902/896.png)
如何通过ip地址为web浏览器控件
这是我的code,但我不知道如何通过IP地址来WebBrowser控件。
IPHostEntry主机;
字符串localIP =?;
主机= Dns.GetHostEntry(Dns.GetHostName());
的foreach(在File.ReadAllLines串行(proxy.txt))
{
的IPAddress的ip = IPAddress.Parse(线);
如果(ip.AddressFamily.ToString()==网间)
{
localIP = ip.ToString();
textBox1.Text = ip.ToString();
//这个code不起作用,它只是一个假设的例子:
webBrowser1.SourceIPAddress = IP;
WebBrowser1.Navigate时(textBox2.Text);
}
}
这是我想通过IP地址来webBrowser控件
//将code不起作用,它只是一个假设的例子:
webBrowser1.SourceIPAddress = IP;
![VB使用webbrowser控件访问网页](https://p.xsw88.cn/allimgs/daicuo/20230902/896.png)
解决方案
只是写在文本 http://74.125.236.211
或
textBox2.Text =http://74.125.236.211
How to pass IPAddress to webBrowser control
This is my code but i don't know how to pass ip-address to webBrowser control.
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);
}
}
this is how i want to pass ip-address to webBrowser control
//The code doesn't work, it's just a hypothetical example:
webBrowser1.SourceIPAddress = ip;
解决方案
Just Write in your textbox http://74.125.236.211
or
textBox2.Text="http://74.125.236.211"
相关推荐
最新文章