does anyone know how get the serial number of a floppy disk??
thanx
Printable View
does anyone know how get the serial number of a floppy disk??
thanx
Using the EventVB.dll (downloadable from the Merrion Computing Website it can be done thus:
HTH,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
Duncan
Since when do diskettes have serial numbers?
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
Well, there you have it!!! Who says you can't teach an old dog new tricks! :D I did not know that! :)
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?
Oopps!
I was reading it wrong. It does work.
Never mind :)