این هم یک برنامه کوچولو برای انتقال اطلاعات به فلش مموری
امیدوارم مفید واقع بشه
کد:
Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
Private Sub Form_Load()
Dim fs As New FileSystemObject
Dim int_number As Long
Dim int_drive As Long
Dim drive As String
Dim t_f As Boolean
For int_drive = 67 To 90
drive = Chr(int_drive) & ":"
Label1.Caption = drive & " " & " ÏÑÇíæ ÝáÔ "
int_number = GetDriveType(drive)
If int_number = 2 Then
On Error GoTo next1
t_f = fs.FileExists(drive & "\pis_mar1.mdb")
If t_f = False Then
FileCopy "C:\proje1\pis_mar.mdb", drive & "\pis_mar1.mdb"
Exit For
End If
t_f = fs.FileExists(drive & "\pis_mar2.mdb")
If t_f = False Then
FileCopy "C:\proje1\pis_mar.mdb", drive & "\pis_mar2.mdb"
Exit For
End If
t_f = fs.FileExists(drive & "\pis_mar3.mdb")
If t_f = False Then
FileCopy "C:\proje1\pis_mar.mdb", drive & "\pis_mar3.mdb"
Exit For
End If
t_f = fs.FileExists(drive & "\pis_mar4.mdb")
If t_f = False Then
FileCopy "C:\proje1\pis_mar.mdb", drive & "\pis_mar4.mdb"
Exit For
End If
t_f = fs.FileExists(drive & "\pis_mar5.mdb")
If t_f = False Then
FileCopy "C:\proje1\pis_mar.mdb", drive & "\pis_mar5.mdb"
Exit For
End If
t_f = fs.FileExists(drive & "\pis_mar6.mdb")
If t_f = False Then
FileCopy "C:\proje1\pis_mar.mdb", drive & "\pis_mar6.mdb"
Exit For
End If
t_f = fs.FileExists(drive & "\pis_mar7.mdb")
If t_f = False Then
FileCopy "C:\proje1\pis_mar.mdb", drive & "\pis_mar7.mdb"
Exit For
End If
FileCopy "C:\proje1\pis_mar.mdb", drive & "\pis_mar1.mdb"
Exit For
End If
Next
next1:
End Sub