گرفتن ip این کد تو یه کلاس بنویس
public static string GetIpAddress()
{
try
{
string strHostName = System.Net.Dns.GetHostName();
string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetVa lue(0).ToString();
return clientIPAddress;
}
catch { return ""; }
}
هر جا هم به این صورت صداش بزنی GetIpAddress() ای پی اون سیستم رو بر میگردونه
اینم برای سیستم نام و مک ادرس
public static string GetMacAddress()
{
try
{
string strHostName = System.Net.Dns.GetHostName();
string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetVa lue(0).ToString();
return clientIPAddress;
}
catch { return ""; }
}
public static string GetSystemName()
{
try
{
string strHostName = System.Net.Dns.GetHostName();
return strHostName;
}
catch { return ""; }
}