Click here to Skip to main content
15,885,000 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
what is the simplest way to auto detect USB insertion and removal i know there are projects here that show it but either are outdated or not what im after
which is just for the application to auto detect USB insertion and removal and display a message box saying which has occurred
i honestly have no clue on how to add it into my WPF application
Can someone break down how to detect USB and what happens


C#
class USBDetection
    {
        public void USBConnected(object sender, EventArgs e)
        {
            MessageBox.Show("USB Connected");
        }
        public void USBRemoved(object sender, EventArgs e)
        {
            MessageBox.Show("USB Removed");
        }
    }


please no links to old projects as if try them and still cannot get them to work
Posted

1 solution

 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 13-Oct-15 2:54am    
5ed.
—SA
Abhinav S 13-Oct-15 2:57am    
Thank you SA.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900