I want to write a program that is to enter a password when trying to enter certain folder. Any idea?
I want to write a program that is to enter a password when trying to enter certain folder. Any idea?
Access a folder through what? Your program or through the OS shell? Through your program, it's simple. When you take the path name, check to see whether they need special access to that folder and then prompt them to enter the password. If you mean through the shell like Windows Explorer, then only the shell can decide whether to prompt for a password on access.
If you're just looking to block people from your files, create another profile on your OS and set up a password for that or compress your files into a .ZIP with a password.
Sent from my iPadŽ
Under Linux, remove execute access for the directory.
Code:$ chmod -x directory
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
Won't that still allow them to list/see what files are in there?
I've always been a bit puzzled as to why windows (or any other GUI OS) doesn't seem to have competent folder passwording.... you can encrypt a large portion of space through making profiles... but what if you just want to encrypt/password a select few folders within a profile (i.e. prompt before entry)?? zipping/unzipping could take hours if they're large in size and making a new profile for each tier of security is tedious and redundant...
IF you walk away from your computer, lock it (WindowsKey + L). Don't let other people know your user's password. Only allow yourself (your user account) access to those folders (using NTFS security permissions).
For someone else to access the folders, make them run a special program owned by your user that asks for a password before granting them access.
Last edited by itsme86; 07-03-2006 at 06:57 PM.
If you understand what you're doing, you're not learning anything.
I'm sure we've all been in the situation where a friend occasionally comes over to visit and uses your computer. All your media/games/software is on your account so naturally thats the one you want allow him/her to use. Now lets say there is just one or two folders that are private that you do not want even your friend to see. It would make no sense to make him/her their own seperate account since a) it would just be an exact duplicate of yours, minus those two folders, b) you would have to update both accounts everytime a change was made to one, and c) he/she is not over enough times to warrant all of that fuss.
It would be nice if there were someway that you could allow your friend to enjoy all your media/software/games on your account while still having those one or two folders off-limits until the correct password is entered. This way anyone on your account can access what you want them to, but only you (the password knower) can respond accurately to a real-time password prompted folder. And the sad thing is, without completely revamping/tinkering/recreating the OS itself, any C/C++ internal browser used to block a folder can simply be bypassed by going through the native OS browser.
> there is just one or two folders that are private that you do not want even your friend to see.
Sounds like a job for! REMOVABLE STORAGE MAN
I'd suggest reducing your porn intake.
it's ironic considerate rarity patron of love higher knowledge engulfs me...
Use the All Users -> My Documents folder for the shared stuff?
If you understand what you're doing, you're not learning anything.
TrueCrypt it and mount when necessary.
Code:#include <stdio.h> void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){ puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9 /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i] ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][ t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}