Article View: borland.public.cppbuilder.nativeapi
Article #16129Re: unique identifier of your computer
From: Mike Collins
Date: Sat, 31 May 2003 22:01
Date: Sat, 31 May 2003 22:01
35 lines
2083 bytes
2083 bytes
Hi Mike,
We do exactly the same thing! I found the easiest way to generate a unique
ID is to create a new GUID using the CoCreateGuid function, thus:
AnsiString szGUID = NULL;
GUID guid;
if (CoCreateGuid(&guid)==S_OK)
{
OLECHAR cBuff[50];
ZeroMemory(cBuff, sizeof(cBuff));
if ((StringFromGUID2(guid, cBuff, 50))==(MAX_GUID_SIZE+1))
{
szGUID = AnsiString(cBuff);
}
}
Alternatively, you could concatenate together several other pieces of
information which is specific to the target PC i.e. Computer Name, Domain
Name, MAC address, IP address etc.
HTH
Mike C
"Mike H." <mikH@joymail.com> wrote in message
news:3ed8d2c9$1@newsgroups.borland.com...
> Hello,
>
> to protect my application from distribution, i like to generare a unique
> identifier of the computer where my application runs. the user give us his
> unique id und he gets a key from us. his puts the key inside the
> application, which write the key to the registry.
>
Technical Details
Message-ID:
<3ed92560$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!38.144.126.75.MISMATCH!feed1.newsreader.com!newsreader.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3ed8d2c9$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,e96c6a7e8e688897 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-05-31 15:01:28 PST Reply-To: "Mike Collins" <mikec@kr8.co.uk> From: "Mike Collins" <mikec@kr8.co.uk> Newsgroups: borland.public.cppbuilder.nativeapi References: <3ed8d2c9$1@newsgroups.borland.com> Subject: Re: unique identifier of your computer Date: Sat, 31 May 2003 23:01:47 +0100 Lines: 37 Organization: kr8 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 81.2.78.34 Message-ID: <3ed92560$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1054418272 81.2.78.34 (31 May 2003 14:57:52 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!38.144.126.75.MISMATCH!feed1.newsreader.com!newsreader.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail