asp.net 获取服务器信息

2024-12-12 19:30:45
推荐回答(3个)
回答1:

using System.Management;

string stringMAC = "";

string stringIP = "";

ManagementClass MC = new ManagementClass "Win32_NetworkAdapterConfiguration");

ManagementObjectCollection MOC= MC.GetInstances();

foreach(ManagementObject MO in MOC)

{

if ((bool)MO["IPEnabled"] == true)

{

stringMAC += MO["MACAddress"].ToString();

TextMAC.Text = stringMAC.ToString();

string[] IPAddresses = (string[]) MO["IPAddress"];

if(IPAddresses.Length > 0)

stringIP = IPAddresses[0];

TextIP.Text = stringIP.ToString();

}

}
另外,团IDC网上有许多产品团购,便宜有口碑

回答2:

using System.Management;

string stringMAC = "";

string stringIP = "";

ManagementClass MC = new ManagementClass "Win32_NetworkAdapterConfiguration");

ManagementObjectCollection MOC= MC.GetInstances();

foreach(ManagementObject MO in MOC)

{

if ((bool)MO["IPEnabled"] == true)

{

stringMAC += MO["MACAddress"].ToString();

TextMAC.Text = stringMAC.ToString();

string[] IPAddresses = (string[]) MO["IPAddress"];

if(IPAddresses.Length > 0)

stringIP = IPAddresses[0];

TextIP.Text = stringIP.ToString();

}

}
另外,虚机团上产品团购,超级便宜

回答3:

我很久没用了 是server. 你点出来有个什么name的 那就是服务器信息