Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Getting Hardware Information

Posted on 2000-03-18
5
Medium Priority
?
167 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 300 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

704 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