Soyez le premier à donner votre avis sur cette source.
Vue 19 581 fois - Téléchargée 602 fois
'******************************************************************************************** ' Name : xIsDriveReady ' Purpose : Test if a drive is exist and is ready to be used ' Syntax : xIsDriveReady(DriveName) ' Parameters : DriveName : The drive name or full path. ' eg: "c", "c:", "c:windows", or "my computermy directory" ' Return : True is the drive is ready, False if it is not '******************************************************************************************** Public Function xIsDriveReady(ByVal DriveName As String) As Boolean Dim objFileSys As Object Dim objDrive As Object Dim strDrive As String On Error GoTo DriveError If Left(DriveName, 1) = "" Then strDrive = DriveName ' If it is a network path, then let it as it is. Else strDrive = Left(DriveName, 1) & ":" ' Create the drive name, to be sure it is in the correct format. eg: "C:" End If Set objFileSys = CreateObject("Scripting.FileSystemObject") ' Create the filesystem object Set objDrive = objFileSys.GetDrive(CStr(strDrive)) If objFileSys.DriveExists(strDrive) Then ' Test if the drive exist xIsDriveReady = objDrive.IsReady ' Test if it is ready to be used Else xIsDriveReady = False End If Exit Function DriveError: xIsDriveReady = False End Function
18 avril 2007 à 14:20
Une fois que j'ai msi ce code dans un module je fais comment pour l'appeler ?
Je désire remplir une Combo_box avec les lecteur de disponible sur le pc ...
Merçi !!!
5 juil. 2006 à 10:43
18 août 2002 à 19:05
2 mai 2002 à 12:51
F___
20 janv. 2002 à 16:38
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.