Uso vba e uso il seguente codice per inteccettare la chiave usb.
il problema è che su non tutti i pc la lettera associata alla chiave è F:\...
come posso fare?
Grazie
Luisa
codice:Private Declare Function GetLogicalDriveStrings Lib "kernel32" Alias _ "GetLogicalDriveStringsA" (ByVal nBufferLength As Long, ByVal lpBuffer As _ String) As Long Private Sub Form_Load() Dim S As String S = String(255, Chr(0)) GetLogicalDriveStrings 255, S D = Split(S, Chr(0)) For A = 0 To UBound(D) If D(A) = "F:\" Then MsgBox "TROVATA" Exit For Else If D(A) <> "" Then 'MSgBox D(A) + " - " + Dir(D(A), vbVolume) End If End If Next A End Sub

Rispondi quotando
SOLAMENTE all'avvio del form, e ciò non ti permette di intercettare la presenza della chiave: basta che la chiave sia immessa dopo che è stato espletato l'evento Load e non avrai risultati..
questa è la prima cosa che ho fatto...
posso sapere qual'è il tuo presentimento? se mi dai dei suggerimenti...
