[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 269
  • Last Modified:

Unique system ID

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
princemahesh
Asked:
princemahesh
1 Solution
 
SlavakCommented:
for what purpose you need it?
0
 
MarcGCommented:
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
 
MarcGCommented:
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
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.

 
VSFCommented:
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
 
VSFCommented:
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
 
VSFCommented:
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
 
ComTechCommented:
princemahesh, you did not answer the first question.  What do you need it for.  Homework???  Please answer my question.

ComTech
Community Support Moderator
0
 
Tech_EdCommented:
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
 
VSFCommented:
Oppss...!
Thats not good!
0
 
MoondancerCommented:
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
 
geobulCommented:
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now