Solved

Getting Hardware Information

Posted on 2000-03-18
5
159 Views
Last Modified: 2010-04-04
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
Comment
Question by:icarey
5 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 2631181
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
 
LVL 17

Expert Comment

by:inthe
ID: 2631263
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
 
LVL 1

Expert Comment

by:yk030299
ID: 2634652
listen
0
 

Accepted Solution

by:
grodgers earned 100 total points
ID: 2634902
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
 

Expert Comment

by:laustjensen
ID: 3754432
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now