Solved

Unique system ID

Posted on 2001-09-05
13
251 Views
Last Modified: 2010-04-06
Is there any way i can get any code which is unique to a system. ProductID or something.

I am also looking for a code/Function which takes a string and encrypts that string and returns that encrypted string  
0
Comment
Question by:princemahesh
13 Comments
 
LVL 3

Expert Comment

by:Slavak
Comment Utility
for what purpose you need it?
0
 
LVL 3

Expert Comment

by:MarcG
Comment Utility
look in the registry for
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion, there is a key called ProductID. I think this is what you were looking for.
0
 
LVL 3

Expert Comment

by:MarcG
Comment Utility
Or you could get the Serial number of the harddisk. I've seen a question about getting that number here lately ...

Or mix it with the ProductID ...
0
 
LVL 3

Expert Comment

by:MarcG
Comment Utility
0
 
LVL 3

Expert Comment

by:VSF
Comment Utility
Take a look at this question to know how to read HDD Serial Number
http://www.experts-exchange.com/jsp/qShow.jsp?ta=delphi&qid=20170016

As the HDD serial number can be changed easily I sugest you use some BIOS INFO as unique keys for your app

This function will return complete information os the BIOS as text!
function GetBiosInfoAsText: string;
  var
    p, q: pchar;
  begin
    q := nil;
    p := PChar(Ptr($FE000));
    repeat
      if q <> nil then begin
        if not (p^ in [#10, #13, ' '..'~' , '?' , '?' ]) then begin
          if (p^ = #0) and (p - q >= 8) then begin
            Result := Result + TrimRight(String(q)) + #13#10;
        end;
          q := nil;
        end;
      end else
         if p^ in ['!'..'~' , '?' , '?' ] then
          q := p;
      inc(p);
    until p > PChar(Ptr($FFFFF));
    Result := TrimRight(Result);
  end;

procedure TForm1.Button1Click(Sender: TObject);
begin
memo1.Lines.text:=GetBiosInfoAsText;
end;



//SIMPLE CODE TO RETURN BIOS DATE AS TEXT
procedure TForm1.Button1Click(Sender: TObject);
begin
edit1.text:=String(PChar(Ptr($FFFF5)));
end;

Hope This helps!
VSF
0
 
LVL 3

Accepted Solution

by:
VSF earned 50 total points
Comment Utility
NuttyProfessor Graded me with an A on this link for this above answer
http://www.experts-exchange.com/jsp/qShow.jsp?ta=delphi&qid=20170016


Here is complete and easy to use function to get HDD serial number:

function GetVolumeID(DriveChar: Char): String;
var
  MaxFileNameLength, VolFlags, SerNum: DWord;
begin
  if GetVolumeInformation(PChar(DriveChar + ':\'), nil, 0,
     @SerNum, MaxFileNameLength, VolFlags, nil, 0)
  then
  begin
    Result := IntToHex(SerNum,8);
    Insert('-', Result, 5);
  end
  else
   Result := '';
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
edit1.text:=GetVolumeID(extractfilepath(application.exename)[1]);    //This will return the drive where
the program is runnig into (Note: it may not be the C drive!)
end;


This should do it!
VSF
www.victory.hpg.com.br
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 3

Expert Comment

by:VSF
Comment Utility
Now talking about the encryption routine... there many available!
Just choose one and start using it!
Try this one!

...encrypt a password ?
procedure TForm1.Button1Click(Sender:TObject);
var
s : string[255];
c : array[0..255] of Byte absolute s;
i:Integer;
begin
{encode}

s:='siro_com developers';
For i:=1 to ord(s[0]) do c[i] := 23 XOr c[i];
Label1.Caption:=s;

{Decode}

s:=Label1.Caption;
For i:=1 to Length(s) do s[i] := 23 XOr ord(s[i]));
Label2.Caption:=s;
end;

Hope this helps!
VSF
www.victory.hpg.com.br
0
 

Expert Comment

by:ComTech
Comment Utility
princemahesh, you did not answer the first question.  What do you need it for.  Homework???  Please answer my question.

ComTech
Community Support Moderator
0
 

Expert Comment

by:Tech_Ed
Comment Utility
princemahesh,

You appear to have two accounts here at Experts Exchange, although the site rules and guidelines permit you to have only one account. Please advise which account you wish to keep open and I will close the other.

Tech_Ed
Community Support Administrator
0
 
LVL 3

Expert Comment

by:VSF
Comment Utility
Oppss...!
Thats not good!
0
 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101 or Netminder will return to finalize these if they are still open in 14 days.  Experts, please post closing recommendations before that time.

Below are your open questions as of today.  Questions which have been inactive for 21 days or longer are considered to be abandoned and for those, your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.20178810.html
http://www.experts-exchange.com/questions/Q.20246239.html
http://www.experts-exchange.com/questions/Q.20255268.html
http://www.experts-exchange.com/questions/Q.20255242.html
http://www.experts-exchange.com/questions/Q.20269488.html
http://www.experts-exchange.com/questions/Q.20281446.html
http://www.experts-exchange.com/questions/Q.20283934.html

To view your locked questions, please click the following link(s) and evaluate the proposed answer.
http://www.experts-exchange.com/questions/Q.20145081.html
http://www.experts-exchange.com/questions/Q.20246789.html
http://www.experts-exchange.com/questions/Q.20281038.html

*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations.
If you are interested in the cleanup effort, please click this link
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643
POINTS FOR EXPERTS awaiting comments are listed in the link below
http://www.experts-exchange.com/commspt/Q.20277028.html
 
Moderators will finalize this question if in @14 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
 
Thanks everyone.
Moondancer
Moderator @ Experts Exchange
0
 
LVL 17

Expert Comment

by:geobul
Comment Utility
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

split points between MarcG and VSF

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Thanks,

geobul
EE Cleanup Volunteer
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

728 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

9 Experts available now in Live!

Get 1:1 Help Now