资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

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://cdkjz.cn/article/dooeidp.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220