string LocalIp = string.Empty;
string Domain = System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().DomainName;
string Host = System.Net.Dns.GetHostName();
if (!System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable())
{
return null;
}
System.Net.IPHostEntry host = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName());
foreach (System.Net.IPAddress ip in host.AddressList)
{
if (ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
{
LocalIp = ip.ToString();
break;
}
}
string IpWidHost = String.Format("[Domain-{0} : Host-{1} : IP-{2}]", Domain, Host, LocalIp);
Hitesh KumarPosted Jan 31, 2015, 3:41 AM
Get Operating system, ram info, harddisc, Computer name using WMI Classeshttp://www.codesolution.org/?p=78