title: Lock files to prevent deletion by anything other than my program
body: <p>I want to lock down some files in a folder to prevent other users from deleting/editing them. Then if my program wants to move or delete the file, it temporarily unlocks it, moves/deletes, then relocks it (if moved) to prevent deletion again. </p>
  
  <p>I've read a bit about the filestream read-only property that would stop this - Can I set this property without actually setting up a stream between the program and my file? Are there any other better ways in VB.NET? It needs to prevent file deletions/moves/edits by non administrators unless done so through the program.</p>
  
  <p>Ultimate goal is to bit by bit lock a number of files and folders and only allow my program to move/delete files, this would ensure that only "approved" moves are allowed (I would use <code>filesystemwatch</code> to monitor "unapproved moves" by comparing a database of these with a database of "approved" moves). </p>