Solved

Getting Hardware Information

Posted on 2000-03-18
5
166 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month4 days, 4 hours left to enroll

630 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