Hello.. it's me, again :mrgreen:
sorry but I really need code for locking folder
not a code for changing the attribut. :(
'cause i want to put my precious file in that folder :(
so my friend can't steal it :evil: .

Everybody in the world who can/want to help me please send your little
knowledge to this newbies

Recommended Answers

All 2 Replies

More or less on every operating system you have to cope with folder's attributes to enforce some way of protection to it's contents. One way is being the root of the system and provide the necessary changes to directory's attributes and making it unaccessible for any other user or simply hiding it. Since this forum especially is for coding (C/C++) my personal advice is to go to the right forum first or (the better option) - consider a lot of coding and reading. In the end you'll be able to protect yourself from some considerable number (at least) of actual or only virtual ;) enemies.

>sorry but I really need code for locking folder
If I recall correctly, you never specified what you think "locking a folder" means. So, instead of starting a new thread with the same stupid question, why not try asking a better question, as I suggested in your last thread?

>not a code for changing the attribut.
Okay, okay, here's the super secret code for "locking" a folder so that nobody can get to the file:

#include <windows.h>

int main()
  RemoveDirectory ( "my_super_secret_folder" );

Please don't post about this question again until you're smart enough to realize that permissions and attributes are the only way to "lock" a file (as you're using the term) aside from deleting it.

>so my friend can't steal it
Encrypt the file, put it on a thumb drive and keep chained to your pocket if you're so worried about it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.