to display doc file in text format asp.net c#
<p>i want to read content of file.but these code is not helping.</p>

<pre><code>string[] readText = File.ReadAllLines(path); this line is giving error.

protected void btnRead_Click(object sender, EventArgs e)
{
    string path = fileupload1.PostedFile.FileName;
    if (!string.IsNullOrEmpty(path))
    {
        string[] readText = File.ReadAllLines(path);
        StringBuilder strbuild = new StringBuilder();
        foreach (string s in readText)
        {
            strbuild.Append(s);
            strbuild.AppendLine();
        }
        textBoxContents.Text = strbuild.ToString();
    }
}
</code></pre>
