文件名称:c#中获取服务器IP
文件大小:2KB
文件格式:TXT
更新时间:2014-09-14 01:25:00
c#
获取cpu序列号,硬盘ID,网卡MAC地址 privatevoidstring cpuInfo ="";//cpu序列号 ManagementClass cimobject =new ManagementClass("Win32_Processor"); ManagementObjectCollection moc =foreach(ManagementObject mo in= mo.Properties["ProcessorId"].Value.ToString(); Response.Write ("cpu序列号:"+//获取硬盘ID String HDid; ManagementClass cimobject1 =new ManagementClass("Win32_DiskDrive"); ManagementObjectCollection moc1 =foreach(ManagementObject mo in= (string)mo.Properties["Model""硬盘序列号:"+//获取网卡硬件地址 =new ManagementClass("Win32_NetworkAdapterConfiguration"); ManagementObjectCollection moc2 =foreach(ManagementObject mo inif((bool)mo["IPEnabled"] ==true"MAC address\t{0}"+mo["MacAddress"