|
-
Feb 1st, 2002, 05:53 AM
#1
Thread Starter
Lively Member
diskette serial number
does anyone know how get the serial number of a floppy disk??
thanx
-
Feb 1st, 2002, 06:40 AM
#2
Frenzied Member
Using the EventVB.dll (downloadable from the Merrion Computing Website it can be done thus:
Code:
Option Explicit
Dim WithEvents vbLink As EventVB.APIFunctions
Private Sub Form_Load()
Set vbLink = New EventVB.APIFunctions
Dim volThis As ApiVolume
For Each volThis In vbLink.System.Volumes
Debug.Print volThis.RootName & " - " & volThis.SerialNumber
Next volThis
End Sub
HTH,
Duncan
-
Feb 1st, 2002, 07:14 AM
#3
Since when do diskettes have serial numbers?
-
Feb 1st, 2002, 08:48 AM
#4
Frenzied Member
If you do a DIR command in NT you get something like:
Volume in drive A is LABELA
Volume Serial Number is 0046-7A7B
Directory of A:\
etc.
Every type of volume has a serial number which can be got with a call to GetVolumeInfo API call.
HTH,
Duncan
-
Feb 1st, 2002, 10:14 AM
#5
Well, there you have it!!! Who says you can't teach an old dog new tricks! I did not know that!
-
Feb 5th, 2002, 11:28 AM
#6
Lively Member
I tried this, but it doesn't come up with the right data.
VB Code:
Dim strBuffer As String
Dim lngNameSize As Long
Dim lngSerial As Long
Dim lngMaxComp As Long
Dim lngFlags As Long
Dim strSystemNameBuffer As String
Dim lngSystemNameSize As Long
GetVolumeInformation "c:\", strBuffer, lngNameSize, lngSerial, lngMaxComp, lngFlags, strSystemNameBuffer, lngSystemNameSize
MsgBox strBuffer & vbCrLf & Str(lngNameSize) & vbCrLf & Str(lngSerial) & vbCrLf & Str(lngMaxComp) & vbCrLf & Str(lngFlags) & vbCrLf & strSystemNameBuffer & vbCrLf & Str(lngSystemNameSize)
According to the DLL-function, the serial should be a long, although the one you see in DOS-mode is eg. 4076-20A2. I assume it is a formatted hex-number. Seems to me, the function always spits up 255 as the serialnr.
I am probably using it wrong 
Ideas?
-
Feb 5th, 2002, 11:31 AM
#7
Lively Member
Oopps!
I was reading it wrong. It does work.
Never mind
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
|