快上网专注成都网站设计 成都网站制作 成都网站建设
成都网站建设公司服务热线:028-86922220

网站建设知识

十年网站开发经验 + 多家企业客户 + 靠谱的建站团队

量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决

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://6mz.cn/article/dooeidp.html

其他资讯