How to prevent file to be copied

S

sajin

Hi All,

I am having a vb.net (VS 2005) application which creates some files in
the Program Files foldes ( lets say 'Test') , but as usual when i
uninstall this application i remove the folder from the Program
Files but the thing is that if the user is bright enough and he did a
copy paste to his personal before uninstalling , then he can use that
file

How can i prevent this , i got the idea of disabling the copy
functionality from the folder called 'Test'

How can i do this......any help will be appreciated

Thanks and Regards
-Sajin
 
C

Cor Ligthert [MVP]

Sajin,

You have already investigated what this means for use on Vista?

Cor
 
W

William LaMartin

Why not encrypt the data you put in the file and decrypt it when you need to
use it?

Then if the user copies the file it will be of no use to him.
 
R

Rad [Visual C# MVP]

Hi All,

I am having a vb.net (VS 2005) application which creates some files in
the Program Files foldes ( lets say 'Test') , but as usual when i
uninstall this application i remove the folder from the Program
Files but the thing is that if the user is bright enough and he did a
copy paste to his personal before uninstalling , then he can use that
file

How can i prevent this , i got the idea of disabling the copy
functionality from the folder called 'Test'

How can i do this......any help will be appreciated

Thanks and Regards
-Sajin

Hey Sajin,

It's not entirely wise to store data in the program files folder. User data
should be kept in the Application Data Folder. You can get this folder like
so:

Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)

As for preventing clever users from using their own copy or manipulating
the existing data, that will take a bit more work. Preventing copying of a
file is harder than it sounds, especially with almost everyone running as
administrator!

You'll need a very simple way of determining whether a change was made by
the application or by the user. Perhaps every time you update the user data
with the application, store a MD5 hash of the file combined with a MD5 hash
of some other data, perhaps the installation date somewhere. Then check
these every time you access the data. This way you will know:

1) If the user changed an existing data file (File MD5 will differ)
2) If the user has uninstalled and installed again (Installation date MD5
will differ)

Its not bulletproof but should keep casual "hackers" very busy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top