Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>try using the WMI <a href="http://msdn.microsoft.com/en-us/library/aa394072%28VS.85%29.aspx" rel="noreferrer">Win32_BaseBoard Class</a> .</p> <p>see theses samples:</p> <p><strong>Option 1)</strong> before execute you need import the <code>Microsoft WMIScripting Library</code> from <code>Component</code>-><code>Import Component</code> and then select <code>Import type library</code></p> <pre><code>program GetWMI_MotherBoardInfo; {$APPTYPE CONSOLE} uses ActiveX, Variants, SysUtils, WbemScripting_TLB in '..\..\..\Documents\RAD Studio\5.0\Imports\WbemScripting_TLB.pas';// Function GetMotherBoardSerial:string; var WMIServices : ISWbemServices; Root : ISWbemObjectSet; Item : Variant; begin WMIServices := CoSWbemLocator.Create.ConnectServer('.', 'root\cimv2','', '', '', '', 0, nil); Root := WMIServices.ExecQuery('Select SerialNumber From Win32_BaseBoard','WQL', 0, nil); Item := Root.ItemIndex(0); Result:=VarToStr(Item.SerialNumber); end; begin try CoInitialize(nil); Writeln('Serial MotherBoard '+GetMotherBoardSerial); Readln; CoUninitialize; except on E:Exception do Begin CoUninitialize; Writeln(E.Classname, ': ', E.Message); Readln; End; end; end. </code></pre> <p><strong>Option 2)</strong> using <code>OLEVariant</code>, <a href="http://msdn.microsoft.com/en-us/library/ms693755%28VS.85%29.aspx" rel="noreferrer">IBindCtx Interface</a> and <a href="http://msdn.microsoft.com/en-us/library/ms679705%28VS.85%29.aspx" rel="noreferrer">IMoniker Interface</a></p> <pre><code>program GetWMI_MotherBoardSerial; {$APPTYPE CONSOLE} uses SysUtils ,ActiveX ,ComObj ,Variants; function GetMotherBoardSerial:String; var objWMIService : OLEVariant; colItems : OLEVariant; colItem : OLEVariant; oEnum : IEnumvariant; iValue : LongWord; function GetWMIObject(const objectName: String): IDispatch; var chEaten: Integer; BindCtx: IBindCtx; Moniker: IMoniker; begin OleCheck(CreateBindCtx(0, bindCtx)); OleCheck(MkParseDisplayName(BindCtx, StringToOleStr(objectName), chEaten, Moniker)); OleCheck(Moniker.BindToObject(BindCtx, nil, IDispatch, Result)); end; begin Result:=''; objWMIService := GetWMIObject('winmgmts:\\localhost\root\cimv2'); colItems := objWMIService.ExecQuery('SELECT SerialNumber FROM Win32_BaseBoard','WQL',0); oEnum := IUnknown(colItems._NewEnum) as IEnumVariant; if oEnum.Next(1, colItem, iValue) = 0 then Result:=VarToStr(colItem.SerialNumber); end; begin try CoInitialize(nil); try Writeln('Serial MotherBoard '+GetMotherBoardSerial); Readln; finally CoUninitialize; end; except on E:Exception do Begin Writeln(E.Classname, ': ', E.Message); Readln; End; end; end. </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload