Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hardrive Serial no

Status
Not open for further replies.

pb4ever

Programmer
Dec 16, 2010
1
ZA
How do n determine the hardrive serial in powerbuilder 11.5
 
From Real's PB How To web site (
Code:
[local external function declaration]
FUNCTION long GetVolumeInformation & 
  (string lpRootPathName, REF string lpVolumeNameBuffer, &
   long nVolumeNameSize, & 
   REF long lpVolumeSerialNumber, REF long lpMaximumComponentLength, & 
   REF long lpFileSystemFlags, REF string lpFileSystemNameBuffer, & 
   long nFileSystemNameSize) & 
   LIBRARY "Kernel32.dll" ALIAS FOR "GetVolumeInformationA"
   
[powerscript]
String ls_volbuffer, ls_fsname
Long  ll_serial, ll_MaxCompLength, ll_FileSystemFlags, ll_rtn

ls_volbuffer = Space(255)
ls_fsname = Space(255)
ll_maxCompLength = 0
ll_FileSystemFlags = 0

ll_rtn = GetVolumeinformation("C:\", ls_volbuffer, 255, ll_serial, & 
                 ll_MaxCompLength, ll_FileSystemFlags , ls_fsname, 255)

// ls volbuffer  - volume name
// ll_serial     - hard disk serial number
// ls_fsname     - file system name ex. NTFS

You may need to use the unicode version of the api call, depending upon your operating system.

Matt

"Nature forges everything on the anvil of time"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top