CD_ROM volume serial no. 
Author Message
 CD_ROM volume serial no.

Can anyone please help me, how can I read volume serial no. of a CD ROM
a sample code will be much appreciated.

Imran



Sat, 13 Jan 2001 03:00:00 GMT  
 CD_ROM volume serial no.
Hi,

Try with this code:
---xxx---
Private Declare Function GetVolumeInformation Lib "Kernel32" _
    Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, _
                                    ByVal lpVolumeNameBuffer As String, _
                                    ByVal nVolumeNameSize As Long, _
                                    lpVolumeSerialNumber As Long, _
                                    lpMaximumComponentLength As Long, _
                                    lpFileSystemFlags As Long, _
                                    ByVal lpFileSystemNameBuffer As String,
_
                                    ByVal nFileSystemNameSize As Long) As
Long

Private Sub Command1_Click()
    Dim lVSN As Long, n As Long, s1 As String, s2 As String
    Dim unidad As String
    Dim sTmp As String

    On Local Error Resume Next
    '
    unidad = Trim$(Text1)
    'Reservar espacio para las cadenas que se pasarn al API
    s1 = String$(255, Chr$(0))
    s2 = String$(255, Chr$(0))
    n = GetVolumeInformation(unidad, s1, Len(s1), lVSN, 0, 0, s2, Len(s2))
    's1 = volume label
    'lVSN = Volume Serial Number
    's2 = FAT, etc.
    'Convert it to hexadecimal to show as Dir does.
    sTmp = Hex$(lVSN)
    Label3(0) = s1
    Label3(1) = Left$(sTmp, 4) & "-" & Right$(sTmp, 4)
    Label3(2) = s2
End Sub
---xxx---

Saludos
Guillermo
--
==================================================
Te invito a visitar mis pginas sobre Visual Basic
http://guille.costasol.net/
==================================================


Quote:
>Can anyone please help me, how can I read volume serial no. of a CD ROM
>a sample code will be much appreciated.

>Imran




Sat, 13 Jan 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Reading Hard-Disk Volume Serial No, CPU Serial No in VB

2. HD VOLUME SERIAL NUMBER

3. Volume Serial Number -- Easy One

4. Volume Serial info

5. Hard Drive Volume Serial Number

6. I WOULD LIKE TO OBTAIN THE SERIAL NUMBER OF VOLUME

7. Retreiving remote volume serial number

8. HD VOLUME SERIAL NUMBER

9. HOW TO change the volume serial number

10. Volume Serial Number????

11. Volume Serial Number -- Easy One

12. Determining Disk Volume Serial Number?

 

 
Powered by phpBB® Forum Software