试试
http://www.aspxboy.com/Files/71/67/272.Aspx

解决方案 »

  1.   

    private void Page_Load(object sender, System.EventArgs e)
    {
    // 在此处放置用户代码以初始化页面
    string cpuInfo = "";//cpu序列号
    ManagementClass cimobject = new ManagementClass("Win32_Processor");
    ManagementObjectCollection moc = cimobject.GetInstances();
    foreach(ManagementObject mo in moc)
    {
    cpuInfo = mo.Properties["ProcessorId"].Value.ToString();
    Response.Write(cpuInfo);
    }
    }
      

  2.   

    谁知道 ManagementClass 如何引用?
      

  3.   

    记得
    using System;
    using System.Management;
      

  4.   

    Msdn 说 System.Management 在 Management.dll 里,可我计算机里没有这个文件。
      

  5.   

    添加引用里面有system.management
      

  6.   

    using System;
    using System.Management;
    using System.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.SessionState;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;namespace WebApplication11
    {
    /// <summary>
    /// WebForm1 的摘要说明。
    /// </summary>
    public class WebForm1 : System.Web.UI.Page {
    private void Page_Load(object sender, System.EventArgs e)
    {
    // 在此处放置用户代码以初始化页面
    string cpuInfo = "";//cpu序列号
    ManagementClass cimobject = new ManagementClass("Win32_Processor");
    ManagementObjectCollection moc = cimobject.GetInstances();
    foreach(ManagementObject mo in moc)
    {
    cpuInfo = mo.Properties["ProcessorId"].Value.ToString();
    Response.Write(cpuInfo);
    }
    }
    #region Web 窗体设计器生成的代码
    override protected void OnInit(EventArgs e)
    {
    //
    // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
    //
    InitializeComponent();
    base.OnInit(e);
    }

    /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器修改
    /// 此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {    
    this.Load += new System.EventHandler(this.Page_Load); }
    #endregion
    }
    }
    缺少Management的引用?
    请帮我试试在你的机子上能运行吗?
      

  7.   

    要在解决方案中添加Management引用!