Click here to Skip to main content
15,889,600 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm currently working on a project that would prevent write access to a usb flash drive when it's inserted into a machine. I've looked into using the FileIOPermission class to make the assembly have read-only access, but would using that class prevent other applications from writing to the drive?
I've also looked at editing the registry from this article[^], but that would prevent write access to all usb devices.

Is there a way to prevent write access to one usb device?
Posted

1 solution

The first thought that comes to mind is using a USB flash-drive that can be password-protected. This company claims its password-protection software is free: [^], but I have never used it.

This CP article may be helpful as a starting point: "Developing a USB Storage Device Protection Tool with C# By Ozcan ILIKHAN | 5 Jun 2009:" [^].

But, it does show techniques for write-protecting all USB drives, not a specific one.

See discussion here: [^] for other ideas. And discussions on SO here:[^].
 
Share this answer
 
v2

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