Solved

Getting Hardware Information

Posted on 2000-03-18
5
163 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Suggested Solutions

Title # Comments Views Activity
Show Listview image from database (String field) 5 143
How to renew a Delphi rad-studio licence? 5 75
SUM 2 INTEGER ARRAYS INTO 1 10 111
Firemonkey webbrowser scrollbars ? 1 57
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 Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

740 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