Click to See Complete Forum and Search --> : Lock txt File
chrisjk
Jan 12th, 2000, 09:44 AM
Hey everyone
Is it possible to get VB to lock a txt file so that it cannot be edited by another prog (e.g. Notepad), even over a network?
Thanks for any help received.
Regards,
------------------
- Chris
chris.kilhams@btinternet.com
If it ain't broke - don't fix it :)
Bob Baddeley
Jan 12th, 2000, 11:28 AM
you can do it with DOS and shell the program from VB. just
Can'ttouchthis = Shell(attrib +R C:\pathname.txt)
I think that's right anyway.
bob
chrisjk
Jan 12th, 2000, 12:14 PM
Thanks Bob, i will give it a shot
Regards,
------------------
- Chris
chris.kilhams@btinternet.com
If it ain't broke - don't fix it :)
da_silvy
Jan 14th, 2000, 04:00 PM
but that can still be opened
attrib +r means that the file is only read only.
that means that it can still be opened and changed by someone who knows how to use attrib, windows or microsoft word.
why don't you encrypt the file?
i have a encrypter that be incorporated into vb if you want, just email me :)
------------------
david
Teenage Programmer
chrisjk
Jan 14th, 2000, 10:52 PM
Thanks Dave but I was really after a way to lock the file, like Explorer.exe which cannot be deleted or moved or anything. The trouble with encryption is they could just delete the symbols and my security system would be ruined...
Thanks anyway,
------------------
- Chris
chris.kilhams@btinternet.com
If it ain't broke - don't fix it :)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.