vb.net设定ip vb net

如何在vb,net用程序修改ip地址

做exe程序获取本机IP地址用

成都创新互联是专业的额尔古纳网站建设公司,额尔古纳接单;提供网站设计、网站建设,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行额尔古纳网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!

System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName()).AddressList

做web程序获取客户端的IP地址用

HttpContext.Current.Request.ServerVariables("REMOTE_ADDR"])

vb.net怎样设置ie浏览器的代理服务器地址

建议你使用注册表的API进行修改

封装两个NET函数给你

private string GetReg(string RegPath)  取得注册表项内容

{

string str="";

RegistryKey hkml = Registry.LocalMachine; 

RegistryKey software = hkml.OpenSubKey("SOFTWARE",true); 

RegistryKey aimdir = software.OpenSubKey("krabs",true);

if (aimdir != null)

{

if (aimdir.GetValue(RegPath) != null)

str = aimdir.GetValue(RegPath).ToString();

if (str != null)

return str;

return null;

}

return null;

}

private bool SetReg(string RegPath,string Data)  //设置注册表内容

{

RegistryKey reg = Registry.LocalMachine;

RegistryKey software = reg.OpenSubKey("SOFTWARE", true);

RegistryKey aimdir1 = software.CreateSubKey("krabs");

if (aimdir1 == null)

return false;

aimdir1.SetValue(RegPath, Data);

return true;

}

vb.net 指定IP端口是否开放

using System.Net;

if(!string.IsNullOrEmpty(txtPort.Text))

{

IPAddress ip = IPAddress.Parse(txtIp.Text);

IPEndPoint point=new IPEndPoint(ip,int.Parse(txtPort.Text));

try

{

TcpClient tcp=new TcpClient();

tcp.Connect(point);

MessageBox.Show("端口打开");

}catch(Exception ex)

{

MessageBox.Show(ex.Message);

}

}

通过以上这个方法,只能判断你是否能链接这个端口。

通过以下这个方法,能判断端口是否开放

public static void GetTcpConnections() 

IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties(); 

TcpConnectionInformation[] connections = properties.GetActiveTcpConnections(); 

string str="";

foreach (TcpConnectionInformation t in connections) 

str+="Local endpoint:"+ t.LocalEndPoint.ToString()+","; 

str+="Remote endpoint:"+ t.RemoteEndPoint.ToString()+","; 

str+=t.State.ToString()+","; 

MessageBox.Show(str);

}


网页名称:vb.net设定ip vb net
链接地址:http://lszwz.com/article/dooeidp.html

其他资讯

售后响应及时

7×24小时客服热线

数据备份

更安全、更高效、更稳定

价格公道精准

项目经理精准报价不弄虚作假

合作无风险

重合同讲信誉,无效全额退款