CONTACT: ICQ 22233 and PM

[VB.NET] Detect USB Drive [Source]

Dr.Trojan

Member
Messages
208
Reaction score
1
'Public Class Form1
' Put this under a button or formload or checkbox, etc


Private Const WM_DEVICECHANGE As Integer = &H219
Private Const DBT_DEVICEARRIVAL As Integer = 32768
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
If m.Msg = WM_DEVICECHANGE Then
If m.WParam = DBT_DEVICEARRIVAL Then
MessageBox.Show("Removable Drive Detected")
End If
End If
MyBase.WndProc(m)
 

pisco

Member
Messages
122
Reaction score
0
nice, i've just used something similar, but had to create the events for it, as i wanted it be automatic.
 

toprak

Member
Messages
4
Reaction score
0
Thank bro thank bro

Thank brothank brothank brothank brothank brothank brothank brothank brothank brothank brothank bro
 

jDevenv

Member
Messages
7
Reaction score
0
En que casos utilizaria ese codigo?... Es posible detectar que puertos estoy usando???...
 
Top