0

为了检索目标机器的一些信息,我使用以下代码:

 ManagementObjectSearcher searcher = new ManagementObjectSearcher("select * from Win32_Processor");
 string collectedInfo = ""; // here we will put the informa

 foreach (ManagementObject share in searcher.Get())
 {
     // first of all, the processorid
     collectedInfo += share.GetPropertyValue("ProcessorId").ToString ();
 }

 searcher.Query = new ObjectQuery("select * from Win32_BIOS");
 foreach (ManagementObject share in searcher.Get())
 {
     //then, the serial number of BIOS
     collectedInfo +=share.GetPropertyValue("SerialNumber").ToString ();
 }

 searcher.Query = new ObjectQuery("select * from Win32_BaseBoard");
 foreach (ManagementObject share in searcher.Get())
 {
     //finally, the serial number of motherboard
     collectedInfo+= share.GetPropertyValue("SerialNumber").ToString();
 }

当它在我的本地计算机上作为 asp.net 网站执行时,它工作正常,但是当我在另一个 Web 服务器上发布它时,它显示一个不同的数字。有没有办法让它计算用户信息,而不是为服务器计算?

4

0 回答 0