Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 169
  • Last Modified:

Getting Hardware Information

I am using Delphi5.
I am trying to get hardware information.
I have read on the function GetSystemInfo and am having trouble understanding how to use it.
I have also looked at the SystemInfo Struct.
It has a type of LPVOID, what is its equivelant in Delphi?

Does this function get the serial number of the processor?

How do I read the MAC address of an Ethernet card?

Do you know of any Web Sites that can give me information on how to protect the software I write such as using a license or serial number?

Many thanks for your help,
Ivan
0
icarey
Asked:
icarey
1 Solution
 
EpsylonCommented:
The equivalent for LPVOID is Pointer (is this case).

It does not return the processor's serial. Most processors don't have a serial.
0
 
intheCommented:
for the mac address look at this unit:

http://vladshar.ufanet.ru/getmacad.zip

or:

Here's another approach, that also retrieves the MAC address, but this doesn't depend on the NetBIOS layer:

function CoCreateGuid(P:Pointer):Integer;stdcall;external 'ole32.dll';

function GetNicAddr:AnsiString;
var
  T:AnsiString;
  I:Integer;
begin
  Result:='';
  SetLength(T,16);
  if CoCreateGUID(@T[1])=S_OK then begin
    for I:=11 to 15 do Result:=Result+IntToStr(Ord(T[I]))+'.';
    Result:=Result+IntToStr(Ord(T[16]));
  end;
end;

for getting system information you should get one of these comps :

delphi 3:
http://www.bhnet.com.br/~simonet/archive/assysinf.zip

delphi4 / 5 see here:
http://www.bhnet.com.br/~simonet/omnitools.htm

Regards Barry
0
 
yk030299Commented:
listen
0
 
grodgersCommented:
Hi icary:

John Ayers has a book with the title "The Tomes of Delphi 3, WIN32 Core API" and inside this book there is a CD with a very good help file that gives examples such as the one you are seeking. I suggest its a good buy just to
get tons of API examples that work. Probably contributed to the JEDI project.

There is a definite working example of GetSystemInfo in his help file accompanying the book on CD.  As I didn't want to get myself into hot water violating copyright restrictions they stipulated, I didn't paste it in here.

I can tell you in the example, you have to specify processor constants and the function does not appear to return the serial number but does return type, no. of processors, memory locations, etc.

The ISBN for the book is 1-55622-556-3 should you wish to get this information but so much more than that is of use that can be found.
0
 
laustjensenCommented:
The MAC of a LAN-machine can be found using the function GetMacAddresses(const Machine: string; const Addresses: TStrings): Integer; found in the JEDI Code Library (JCL). This can be fetched from http://www.delphi-jedi.org. It is free, it works and it doesn't spawn external processes to resolve the MAC.

What it exactly does, I don't know, but it works :o)

Hope any of you can use it. Enjoy :)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now