c#中获取服务器IP

时间:2014-09-14 01:25:00
【文件属性】:

文件名称: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"


网友评论

  • 兄弟,你这资源分,咋好意思要的啊,哎,上火!是一个txt文档,内容其他地方就有,浪费了分!这分数咋也给个小demo啊