Access USB through vb.net
-
Hi, I need to write a program that controls a camera get the data But to do that we need to call some system dll's. (This is because the camera connects to the computer through the USB port . any one can help AMR-CIS
-
This sample shows how to be notified of a device being plugged in or removed from the system. It uses the WMI's Win32_DeviceChangeEvent class. The class is only available in Windows XP or 2003. Add a reference to system.management for this example. -------------------------------------------------------------------------------- Dim WithEvents w As ManagementEventWatcher Dim q As WqlEventQuery Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load q = New WqlEventQuery("Select * from Win32_DeviceChangeEvent") w = New ManagementEventWatcher(q) w.Start() End Sub Private Sub w_EventArrived(ByVal sender As Object, ByVal e As System.Management.EventArrivedEventArgs) Handles w.EventArrived MessageBox.Show("Device Event", e.Context.ToString) End Sub Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing w.Stop() End Sub