06-01-2013, 04:39 PM
السلام عليكم
لإضافة WbemScripting_TLB إذهب إلى Compement ــ>Import Compement
ثم Import type library
PHP كود :
uses:WbemScripting_TLB
ثم Import type library
كود :
Function GetMotherBoardSerial:string;
var
x:ISWbemLocator;
xs:ISWbemServices;
os:ISWbemObjectSet;
e:IEnumVariant;
c:cardinal;
i:integer;
v,v1:OleVariant;
w:WideString;
begin
x:=CoSWbemLocator.Create;
xs:=x.ConnectServer('.','root/cimv2','','','','',0,nil);
os:=xs.InstancesOf('Win32_BaseBoard',0,nil);
e:=IEnumVariant(os._NewEnum);
w:='';
while e.Next(1,v,c)=S_OK do
begin
if not(w='') then w:=w+' ';
w:=w+VarToWideStr(v.SerialNumber);
Result:='baseboard='+VarToWideStr(v.Description)+
#13#10'Manufacturer='+VarToWideStr(v.Manufacturer) +
#13#10'Model='+VarToWideStr(v.Model)+
#13#10'Version='+VarToWideStr(v.Version)+
#13#10'Product='+VarToWideStr(v.Product)+
#13#10'SerialNumber='+VarToWideStr(v.SerialNumber) ;
end;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
ShowMessage(GetMotherBoardSerial);
end;
أدبني الدهر فأراني نقص عقلي وإذا ما ازددت علما زادني علما بجهلي

