|
-
Dec 7th, 2000, 11:28 AM
#1
Thread Starter
Black Cat
Is there an API call to get the label and/or serial number of a floppy disk?
I want to write a program that will allow one click copying of floppies to a CD-RW. So while the program is running, I click the button, it copies my floppy to a folder named by the floppy label (or serial number if it doesn't have a label), when thats done I can pop out the floppy & copy another one. So I can sit there and backup lots of floppies easily.
Thanks,
Josh
-
Dec 7th, 2000, 03:20 PM
#2
To get the serial number, use the GetVolumeInformation api function.
Code:
Private Declare Function GetVolumeInformation Lib _
"kernel32.dll" Alias "GetVolumeInformationA" (ByVal _
lpRootPathName As String, ByVal lpVolumeNameBuffer As _
String, ByVal nVolumeNameSize As Integer, _
lpVolumeSerialNumber As Long, lpMaximumComponentLength _
As Long, lpFileSystemFlags As Long, ByVal _
lpFileSystemNameBuffer As String, ByVal _
nFileSystemNameSize As Long) As Long
Function GetSerialNumber(strDrive As String) As Long
Dim SerialNum As Long
Dim Res As Long
Dim Temp1 As String
Dim Temp2 As String
Temp1 = String$(255, Chr$(0))
Temp2 = String$(255, Chr$(0))
Res = GetVolumeInformation(strDrive, Temp1, _
Len(Temp1), SerialNum, 0, 0, Temp2, Len(Temp2))
GetSerialNumber = SerialNum
End Function
Usage
MsgBox GetSerialNumber("A:\")
-
Dec 8th, 2000, 10:20 AM
#3
Thread Starter
Black Cat
It's the same one used for hard drives, right?
I overlooked the obvious...
Josh
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|