If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Other PC Databases > How to retrieve SATA serial number in VFP

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-09-08, 23:36
ABY ABY is offline
Registered User
 
Join Date: Jun 2008
Posts: 1
How to retrieve SATA serial number in VFP

I wrote some programs in Visual Foxpro, and I don't want others to use them illegally, so I incuded some codes that I took somewhere in internet to protect the programs.
Unfortunately, the codes only work for IDE Hardisk, not for SATA.
Would anyone please help me to give me some codes that work in SATA?
Here is the codes in VFP for IDE drive:

**** MAIN PROGRAM
...........................
DO HDSerialNumber

*** MAIN PROGRAM CONTINUE

FUNCTION HDSerialNumber
xWMI = getobject("winmgmts:")
xDisks = xWMI.InstancesOf("Win32_PhysicalMedia")
for each xDisk in xDisks
NoSeriHD=xDisk.SerialNumber
exit &&& Only the first Hardisk retrieved
NEXT
NoSeriHD=ALLTRIM(NoSeriHD)

IF NoSeriHd='xxxxxxxxxxxxx' && The Serial Number of 1st HD
RETURN &&& Program Continue
ENDI

***** IF Serial Number doesn't fit, then quit
QUIT
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On