C# 获得本机IP
System.Net.IPAddress[] ips = System.Net.Dns.GetHostAddresses(Environment.MachineName);
string strIP = "";
for(int i=0;i<ips.Length;i++)
{
strIP += ips[i].ToString();
}
this.TextBox1.Text = strIP;
string strIP = "";
for(int i=0;i<ips.Length;i++)
{
strIP += ips[i].ToString();
}
this.TextBox1.Text = strIP;
posted on 2008-06-13 15:01 freeliver54 阅读(1689) 评论(5) 编辑 收藏 举报