Lock Multiple Files at the same time
<p>I'm trying to figure out a way to lock multiple files at the same time. For example, I want to lock test1.txt test2.txt but not lock the rest of the files in the folder.</p>

<p>I currently lock the files by using:</p>

<pre><code>FileStream fileStream = new FileStream("C:\\pathoffile\test1.txt", FileMode.Open,     FileAccess.ReadWrite, FileShare.ReadWrite);
StreamReader streamReader = new StreamReader(fileStream);

fileStream.Lock();

//this is where i check if the file is indeed locked or not

streamReader.Close();
fileStream.Close();
</code></pre>

<p>This works perfectly fine, however I do not want to do this for every file that I lock. I was wondering if there was a simpler way to lock multiple files at once?</p>

<p>Thanks</p>
