protected
string
GetLocalIPAddress()
{
string
IPAddress = string.Empty;
System.Net.
IPHostEntry
host = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName());
foreach
(System.Net.IPAddress
ip in
host.AddressList)
{
if
(ip.AddressFamily.ToString() ==
"InterNetwork")
{
IPAddress = ip.ToString();
}
}
return
IPAddress;
}