Website potential file lock issue
<p>I am writing a blog where I upload text documents to a directory that contain HTML. Using the code below, do you anticipate I will have any issues with file locking or other problems I am not seeing?  I am most concerned about the File.ReadAllText().</p>

<p>The directory will contain a list of files ex:</p>

<p>20120101_2300.txt</p>

<p>20120201_0100.txt</p>

<p>etc...</p>

<pre><code>public class Website
{
    private string directory = "C:\\Web";
    public List&lt;BlogEntry&gt; GetArchives()
    {
        return GetArchives("");
    }

    public List&lt;BlogEntry&gt; GetArchives(string date)
    {
        var files = !string.IsNullOrEmpty(date) ? Directory.GetFiles(directory, "*.txt").Where(t =&gt; t.Contains(date)) : Directory.GetFiles("C:\\Web", "*.txt");
        var sb = files.Select(file =&gt; new BlogEntry {FullPath = file}).ToList();
        return sb.OrderByDescending(t =&gt; t.FileDate).Skip(5).ToList();
    }

    public List&lt;BlogEntry&gt; GetRecent()
    {
        var files = Directory.GetFiles(directory, "*.txt");
        var sb = files.Select(file =&gt; new BlogEntry {FullPath = file}).ToList();
        return sb.OrderByDescending(t =&gt; t.FileDate).Take(5).ToList();
    }
}

public class BlogEntry
{
    public string FullPath { get; set; }

    public DateTime FileDate
    {
        get { return DateTime.ParseExact(Path.GetFileNameWithoutExtension(FullPath), "yyyyMMdd_HHmm", CultureInfo.InvariantCulture); }
    }

    public string FileContents
    {
        get { return File.ReadAllText(FullPath); }
    }
}
</code></pre>
