Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
I want to block data copy from pen drive to Computer and computer to pen drive using c#
Posted
Updated 26-Jan-20 7:41am

I have no idea what you mean by this, but why can't you just copy files back and forth using the File class ?
 
Share this answer
 
Comments
Shubham Soni 21-Jul-12 2:48am    
I guess he mean, he has few media files on a pen drive, and he wan't to make a program which does not let those file to be copied to another pen drive. Basically, he wish to stop copying.
Christian Graus 21-Jul-12 2:57am    
Oh - I am usually good at the version of english that happens around here, but I missed that. You can't do it, without writing your own encrypted file system. If you can access the files, you can copy them. No way to stop it.
First of all, you need to choose a file system. See if a file system do have inbuilt switch copying a particular file of not you need to find hooks tho apis which copies any file, but this would be possible if you wanted to stop copying files from a hard drive, not from a pen drive as no OS will allow you to hook to OS.
Another option would be to encode files and somehow, provide a channel to read it.
Another approach could be, creating two partition one visible and second invisible. the visible one will have your executable which will ask for authentication, if authentication passes, make other partition visible else not.

Hope my answer would help you.
 
Share this answer
 
Comments
vijaya likhar 12-Dec-13 9:10am    
plz tell me proper code...or solution...

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