using System.Net;
string hostName = Dns.GetHostName(); //获取本机主机名
IPHostEntry myself = Dns.GetHostEntry(hostName);//获取本机ip地址信息
IPAddress address = myself.AddressList[0];
this.txtClientIP.Text = address.ToString();
using System.Net;
string hostName = Dns.GetHostName(); //获取本机主机名
IPHostEntry myself = Dns.GetHostEntry(hostName);//获取本机ip地址信息
IPAddress address = myself.AddressList[0];
this.txtClientIP.Text = address.ToString();