Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi WMI Klasse für Kommunikation (https://www.delphipraxis.net/101016-wmi-klasse-fuer-kommunikation.html)

Jackie1983 7. Okt 2007 00:08


WMI Klasse für Kommunikation
 
hi,

möchte gern ein kleines Programm schreiben welches mir die Daten meiner Netzwerkcomputer ausliest.
Habe dazu folgendes im Internet gefunden.
Delphi-Quellcode:
begin
  try
    Locator := CoSWbemLocator.Create;
    Services := Locator.ConnectServer(wmiHost, 'root\cimv2', lUser, lPasswort, '','', 0, nil);
    ObjSet := Services.ExecQuery('SELECT * FROM '+wmiClass, 'WQL',
      wbemFlagReturnImmediately and wbemFlagForwardOnly , nil);
    Enum := (ObjSet._NewEnum) as IEnumVariant;
    while (Enum.Next(1, TempObj, Value) = S_OK) do
    begin
      SObject := IUnknown(tempObj) as ISWBemObject;
      SProp := SObject.Properties_.Item(wmiProperty, 0);
      if VarIsNull(SProp.Get_Value) then
        result := ''
      else
      begin
        SN := SProp.Get_Value;
        result := SN;
      end;
    end;
  except // Trap any exceptions (Not having WMI installed will cause one!)
    on exception do
      result := '-';
    end;
end;
Nur bei machen Werte die ich auslesen möchte funktioniert das nicht.
Bin auf der suche nach einer Klasse die eventuell schon mal jemand programmiert hat.

So in der Art.
Delphi-Quellcode:
var
  SystemInfo : TWMISystemInfo;
begin
  SystemInfo := TWMISystemInfo.create(Host,User,Passwort);
  showmessage(SystemInfo.keineAhnung);
end;
Kann mir da jemand weiter helfen?

Alter Mann 7. Okt 2007 15:21

Re: WMI Klasse für Kommunikation
 
Hallo,

schau Dir das mal an:WMI Beispielprogramm

Jackie1983 7. Okt 2007 16:10

Re: WMI Klasse für Kommunikation
 
sieht nicht schlecht aus. Werde mich damit mal beschäftigen.
thx


Alle Zeitangaben in WEZ +1. Es ist jetzt 22:52 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz