Home » WPFRSS

how to lock and unlock chosen files in vb.net?

I would like to create a program which able to lock several files from unauthorized person to use and unlock it when the authorized person wants to use. Please help me on this in vb.net. Thanks.
 

12 Answers Found

 
 

Answer 2

You can do that in two differents way manually http://support.microsoft.com/?kbid=323525

And if you want to do it programmatically, then try to write a program that implement the second method in the above link.

The limitation to above methods is that it will easy for someone with administrative right and knowledge with system registry to edit the registry and delete the key to restrict application. Due to this, if i have to do it, i will just write a small window service program that run in the background and it will be monitoring the restricted application using process.

kaymaf

 

 

Answer 3

now i am trying to lock files instead of programs.. doing this way, will be more easier right?
 

Answer 4

Can you show me some vb.net sample code in lock and unlock file? thanks

*Assuming someone does not know about the windows registry :)

 

Answer 5

now i am trying to lock files instead of programs.. doing this way, will be more easier right?


For file, just do file encryption

kaymaf

 

Answer 6

Can you show me some vb.net sample code in lock and unlock file? thanks

*Assuming someone does not know about the windows registry :)


Learn how to write and read system registry, i cant just post code for you to manipulate registry bcos it risky.

http://www.codeproject.com/KB/vb/registry_with_vb.aspx

http://www.codeproject.com/KB/vb/cregistry.aspx

Read the articles in the above links on system registry

kaymaf

 

Answer 7

Can you show me some vb.net sample code in lock and unlock file? thanks

*Assuming someone does not know about the windows registry :)


Learn how to write and read system registry, i cant just post code for you to manipulate registry bcos it risky.

http://www.codeproject.com/KB/vb/registry_with_vb.aspx

http://www.codeproject.com/KB/vb/cregistry.aspx

Read the articles in the above links on system registry

kaymaf


CODE CONVERTER SITE

http://www.carlosag.net/Tools/CodeTranslator/ .

http://www.developerfusion.com/tools/convert/csharp-to-vb/ .


i had read through these links..

so far, i am using fingerprint to verify the user. fyi, i can lock a file but not files at this moment :(

thus, i am seeking help from you.

 

Answer 8

Is there a reason you can't just remove read/write/execute permissions on the file for the user(s) that you don't want to access it?
 

Answer 9

Is there a reason you can't just remove read/write/execute permissions on the file for the user(s) that you don't want to access it?

i can lock the file and then unlock the file if the user been verified. for example, i wanted my aaa.txt and bbb.txt to locked from other person to open.

when the user run the program and open aaa.txt, it will ask for verification. after tat, user can only open aaa.txt. the problem is when the user want to open bbb.txt, it wont pop up the verification windows and directly show  the content of file @.@

 

Answer 10

For something like that you're better off going with the previous suggestion of using encryption.  You can have the encryption be dependant on a user entered password so that the correct password is needed to access the file.
 

Answer 11

For something like that you're better off going with the previous suggestion of using encryption.  You can have the encryption be dependant on a user entered password so that the correct password is needed to access the file.

i understand this. Because my program is using fingerprint reader to verify the user, so i think this already consider as encryption.

my problem is fail to lock several files :(

 

Answer 12

i had read through these links..

so far, i am using fingerprint to verify the user. fyi, i can lock a file but not files at this moment :(

thus, i am seeking help from you.

Next time, give more detail about when posting a question. I taught you want to lock executable file, that i was reason i gave you all those links.

"fyi, i can lock a file but not files at this moment"  Can explain this bold line ?  if you can lock a file, then implements the method to lock multiple files unless your meaning is totally differ from my thinking

Lock txt file is just a waste of time, locking file does not prevent copy or rename.  If you really want to protect the file, either you encrypt it or create your own custom file type that will only open within your program.

kaymaf

 


CODE CONVERTER SITE

http://www.carlosag.net/Tools/CodeTranslator/.

http://www.developerfusion.com/tools/convert/csharp-to-vb/.

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter