我在delphi调用是这样的
unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs,ComObj, StdCtrls;type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
  runobj: Variant;
begin
  runobj := CreateOleObject('GetHardwareInf.GetHWInf');
  ShowMessage(runobj.GetIdeSerialNumber);
end;procedure TForm1.Button2Click(Sender: TObject);
var
  runobj: Variant;
begin
  runobj := CreateOleObject('GetHardwareInf.GetHWInf');
  ShowMessage(runobj.HWGetFirstMac );
end;end.

解决方案 »

  1.   

    你可以在vbs js 中调用 给一段vbs的给你set runobj = Createobject("GetHardWareInf.GetHwInf")
    msgbox(runobj.HWGetFirstMac); 手工打的。。你用的时候先把ocx在本地注册一次
      

  2.   

    在脚本里这样调用
    function GetMac()
       {
          var runobj =new ActiveXObject("GetHardwareInf.GetHWInf");
          msgbox(runobj.GetIdeSerialNumber)
        }怎么提示:Automation 服务器不能创建对象
      

  3.   

    对不起,前几日太忙。打工打的打码没测试。所以不好意思 把vbs 和js混成一块给你了这样 
              function getmac()
              {              var runobj = new activexobject("GetHardwareInf.GetHwInf");
                  alert(runobj.GetIdeSeriaINumber);
                   //注msgbox是vbs中的 sorry~~ 
              }把它们放在你的网页HTML中这一小段代码你的ocx必需要注册才能使用,否则会报错误Automation 服务器不能创建对象等等。。
    一般分发ocx控件一般是在网页里面嵌上这个activex 就像flash一样,你可以参考flash对象是怎么放在网页里的 一般是这样<object classid="sdfsdafasfsadfsa"