Discussion Locked

Can I Know Floppy Disk SNo. Using VB6

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

How Can I know the Floppy Disk Serial Number
using VB6,
Explaning :
if i want to copy some VB program to the floppy disk and i want to check the serial nummber of that floppy disk ,what can i to do
with VB6?

4 replies

by bill_h

The following code snippet will retrieve the label, serial number, total space, and free space for a floopy in drive A:

Dim fsoSample As FileSystemObject
Dim drvSample As Drive
Dim sSpecs As String

Set fsoSample = New FileSystemObject
Set drvSample = fsoSample.GetDrive(fsoSample.GetDriveName("A:"))
sSpecs = "Drive " & UCase("A:") & " - "
sSpecs = sSpecs & drvSample.VolumeName & vbCrLf
sSpecs = sSpecs & drvSample.SerialNumber & vbCrLf
sSpecs =sSpecs & "Total Space: " & FormatNumber(drvSample.TotalSize / 1024, 0)
sSpecs = sSpecs & " Kb" & vbCrLf
sSpecs = sSpecs & "Free Space: " & FormatNumber(drvSample.FreeSpace / 1024, 0)
sSpecs = sSpecs & " Kb" & vbCrLf
MsgBox sSpecs

For more information, see the following MSDN articles:

Working with Drives and Folders
http://msdn.microsoft.com/library/devprods/vs6/vbasic/vbcon98/vbconmanipulatingdrivesfolders.htm

-AND-

The File System Objects
http://msdn.microsoft.com/library/devprods/vs6/vbasic/vbcon98/vbconthefilesystemobjects.htm

(If the URLs above do not work, locate and remove any spaces inserted by the TechRepublic system.)

Hope this helps...

by bill_h

Almost forgot...in order for this to work, you will need to reference the Microsoft Scripting Runtime component (scrrun.dll) in your VB project.

This discussion is closed to new replies.