mourad183
Messages postés78Date d'inscriptionmardi 8 avril 2003StatutMembreDernière intervention25 janvier 2007
-
12 mai 2004 à 15:19
BruNews
Messages postés21040Date d'inscriptionjeudi 23 janvier 2003StatutModérateurDernière intervention21 août 2019
-
14 mai 2004 à 12:51
comment faire pour savoir si une disquette existe ou pas????
la meme chose pour le CD
aidez moi svp
mourad183
Messages postés78Date d'inscriptionmardi 8 avril 2003StatutMembreDernière intervention25 janvier 2007 12 mai 2004 à 20:18
Public 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
Public Declare Function SetErrorMode Lib "kernel32" Alias "SetErrorMode" (ByVal wMode As Long) As Long
Public 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
Public Declare Function SetErrorMode Lib "kernel32" Alias "SetErrorMode" (ByVal wMode As Long) As Long
voila les 2 APIs alors fé moi un ptit prg stp :)
Vous n’avez pas trouvé la réponse que vous recherchez ?
BruNews
Messages postés21040Date d'inscriptionjeudi 23 janvier 2003StatutModérateurDernière intervention21 août 2019 12 mai 2004 à 20:40
Bon voila tu remets cela en Declar pour VB.
Public Declare Sub SetErrorMode Lib "kernel32" Alias "SetErrorMode" (ByVal wMode As Long)
Public Declare Function GetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpA As Long, ByVal nA As Long, lpSerNbr As Long, lpB As Long, lpC As Long, ByVal lpD As String, ByVal nD As Long) As Long
Dans le FormLoad de ta 1ere form (ou func Main si tu as):
SetErrorMode 1 ' 1 SEULE FOIS POUR LE PROG
Ensuite quand besoin de savoir si A:\ y est par exemple:
Dim Nbr as Long
If GetVolumeInformation("A:", 0, 0, Nbr, 0, 0, 0, 0) Then
MsgBox "PRESENT"
Else
MsgBox "ABSENT"
End If
BruNews
Messages postés21040Date d'inscriptionjeudi 23 janvier 2003StatutModérateurDernière intervention21 août 2019 12 mai 2004 à 20:41
OUPS, erratum
Public Declare Function GetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpA As Long, ByVal nA As Long, lpSerNbr As Long, lpB As Long, lpC As Long, ByVal lpD As Long, ByVal nD As Long) As Long
BruNews
Messages postés21040Date d'inscriptionjeudi 23 janvier 2003StatutModérateurDernière intervention21 août 2019 12 mai 2004 à 20:44
Encore une modif, pas evident de taper direct ici.
Public Declare Function GetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpA As Long, ByVal nA As Long, lpSerNbr As Long, ByVal lpB As Long, ByVal lpC As Long, ByVal lpD As Long, ByVal nD As Long) As Long