Results 1 to 5 of 5

Thread: Lock txt File

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Post

    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

  2. #2
    Hyperactive Member
    Join Date
    Sep 1999
    Posts
    305

    Post

    you can do it with DOS and shell the program from VB. just

    Code:
    Can'ttouchthis = Shell(attrib +R C:\pathname.txt)
    I think that's right anyway.

    bob

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Post

    Thanks Bob, i will give it a shot

    Regards,

    ------------------
    - Chris
    chris.kilhams@btinternet.com
    If it ain't broke - don't fix it

  4. #4
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527

    Post

    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


  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Post

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width