01-13-2012، 11:44 AM
(آخرین تغییر در ارسال: 01-13-2012، 11:45 AM توسط Amin_Mansouri.)
سلام
اینم کدی که خواستید :
اینم کدی که خواستید :
کد:
Private Declare Function GetDriveType Lib "kernel32.dll" Alias "GetDriveTypeA" _
(ByVal nDrive As String) As Long ' tavasot in api mitonim vaziat driveha ro be dast biarim
Const DRIVE_CDROM = 5 ' inja tarif mikonim mesalan agar drive h az noa cd rom bod addad 5 ro khoroji bede
Const DRIVE_FIXED = 3
Const DRIVE_RAMDISK = 6
Const DRIVE_REMOTE = 4
Const DRIVE_REMOVABLE = 2 ' FLASH DISK
Private Sub Form_Load()
If GetDriveType("h:") = 2 Then 'agar DRIVE AZ noa usb bod dastor zIR EJRA BESHE
MsgBox "detect usb"
Else ' ELSE: AGAR DRIVE H AZ NOA USB NABOD DASTOR ZIR EJRA NASHE
MsgBox ("DRIVE AZ NOA USB NIST")
End If
If GetDriveType("i:") = 2 Then 'agar DRIVE i aZ noa usb bod dastor zIR EJRA BESHE
MsgBox "detect usb"
Else ' ELSE: AGAR DRIVE H AZ NOA USB NABOD DASTOR ZIR EJRA NASHE
MsgBox ("DRIVE AZ NOA USB NIST")
End Sub
گروه دور همی پارسی کدرز
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg