怎么获取计算机的品牌型号,还有CPU的,内存的,硬盘的,网卡硬件地址,操作系统的版本及语言
用WMI好像只可以获取硬件的序列号啊=。。=

解决方案 »

  1.   

    http://hi.baidu.com/xinglong1985/blog/item/f758cda5d8590bfd9052eefd.html
      

  2.   

    用WMI可以获取几乎所有的硬件信息 具体可以参看周公的系列文章 手头没代码 明天回公司给你贴两段看看
    http://blog.csdn.net/zhoufoxcn/archive/2008/01/14/2042697.aspx
      

  3.   

    你可以搜索MS的一个The Portable Script Center的文档 里面囊括了几乎所有的例子 参考procedure TfrmMain.GetCpuInfo();
    var
      Locator,WMI,RET,Tmp: OleVariant;
      Enum: IEnumVariant;
      Value: Cardinal;  iCount,i:Integer;
      tmpstr:string;  cpupercentage:double;
    begin
      try
        iCount:=0;
        cpupercentage:=0;    for i:=0 to iCpuCount-1 do
        begin
          CpuInfoArray[i].ClockSpeed:='';
          CpuInfoArray[i].Manufacturer:='';
          CpuInfoArray[i].ProcessorId:='';
          CpuInfoArray[i].Percentage:='';
          CpuInfoArray[i].WarmInfo:=0;
        end;    Locator:=CreateOleObject('WbemScripting.SWbemLocator');
        WMI:=Locator.ConnectServer('.', '', '', '');
        Ret:=WMI.ExecQuery('select * from Win32_Processor');
        Enum:=IUnknown(RET._NewEnum) as IEnumVariant;
        while(Enum.Next(1,Tmp,Value)=S_OK) do
        begin
          CpuInfoArray[iCount].ClockSpeed   :=NullDef(Tmp.MaxClockSpeed,'0');
          CpuInfoArray[iCount].ClockSpeed   :=CpuInfoArray[iCount].ClockSpeed+'MHZ';
          CpuInfoArray[iCount].Manufacturer :=NullDef(Tmp.Manufacturer,'0');
          CpuInfoArray[iCount].ProcessorId  :=NullDef(Tmp.ProcessorId,'0');
          CpuInfoArray[iCount].Percentage   :=NullDef(Tmp.LoadPercentage,'0');      cpupercentage:=cpupercentage+StrToIntDef(CpuInfoArray[iCount].Percentage,0);      iCount:=iCount+1;
          Tmp:=Null;
        end;
        if icount>0 then
        begin
          if (cpuPercentage/icount)>=FzArr[fzCPU] then
          begin
            tmpstr:=ComputerInfo+' CPU 使用率为'+floatTostr(Round(cpuPercentage/icount))+'%超出阀值';
            AddWarnInfo(now,tmpstr);
            memo1.Lines.Add(tmpstr);
          end;
        end;    iCpuCount:=iCount;
      except
      end;
    end;