- Public Function attendre(intervalle As String, indice As Integer) As Integer
- Valeur = Time
- tmp = DateAdd(intervalle, indice, Valeur)
- Do While Time < tmp
-
- Loop
- End Function
-
- Private Function connectServ(serv As string, Share AS string, Lettre AS string, Pass AS string, usr AS string )
- Dim LigneCommande As String, val, retour As Integer
-
- LigneCommande = "NET USE " & serv & ": \\" & Share & "\" & Lettre & " " & Pass & " /USER:" & usr & " /PERSISTENT:NO"
- retour = Shell(LigneCommande, vbNormalFocus)
- val = attendre("s", 5)
- End Function
-
- Private Function DisconnectServ(Lettre AS string)
- Dim LigneCommande As String, val, retour As Integer
- LigneCommande = "NET USE " & Lettre & ": /DELETE"
- retour = Shell(LigneCommande, vbNormalFocus)
- val = attendre("s", 5)
- End Function
-
Public Function attendre(intervalle As String, indice As Integer) As Integer
Valeur = Time
tmp = DateAdd(intervalle, indice, Valeur)
Do While Time < tmp
Loop
End Function
Private Function connectServ(serv As string, Share AS string, Lettre AS string, Pass AS string, usr AS string )
Dim LigneCommande As String, val, retour As Integer
LigneCommande = "NET USE " & serv & ": \\" & Share & "\" & Lettre & " " & Pass & " /USER:" & usr & " /PERSISTENT:NO"
retour = Shell(LigneCommande, vbNormalFocus)
val = attendre("s", 5)
End Function
Private Function DisconnectServ(Lettre AS string)
Dim LigneCommande As String, val, retour As Integer
LigneCommande = "NET USE " & Lettre & ": /DELETE"
retour = Shell(LigneCommande, vbNormalFocus)
val = attendre("s", 5)
End Function