0

How can Eject pen drive?

Who can help me to write c# code to Eject a pendrive.

21st Mar 2020, 10:49 AM
Sampath Tharanga
Sampath Tharanga - avatar
3 RĂ©ponses
22nd Mar 2020, 12:09 PM
Sampath Tharanga
Sampath Tharanga - avatar
+ 3
Sampath Tharanga Please attach the code so someone can help you in getting error solved. This link maybe helpful in your task. https://stackoverflow.com/questions/7704599/eject-usb-device-via-c-sharp
21st Mar 2020, 11:18 AM
DishaAhuja
DishaAhuja - avatar
0
DishaAhuja yeah ofcourse. I'm find some codes every where. But couldn't find something😂😂😂 Removable drive detecting code section here. Now I want to eject this drive. Who can help me to develop this one 😍😍😍 using System.IO; foreach(DriveInfo drive in DriveInfo.GetDrives()) { if(drive.DriveType == DriveType.Removable ) { // Now here selected only removable drive } }
21st Mar 2020, 12:25 PM
Sampath Tharanga
Sampath Tharanga - avatar