File.OpenText method is not declared error
<p>i have a fileupload control from which i need the path of a text file. After selecting the file,i need to open the file for reading the data from the text file.For this, i used the following code to open the text file.</p>

<pre><code>fp=File.OpenText(FileUpload2.PostedFile.FileName)
</code></pre>

<p>This is working fine in my system.The FileUpload2.PostedFile.FileName statement gives the path of the file.The File.OpenText method opens the selected file.But when i run my project in IIS,it gives the following error:</p>

<pre><code>"File.OpenText is not declared."
</code></pre>

<p>The FileUpload2.PostedFile.FileName  statement is not retrieving the path, it retrieves only only the filename.what could be the reason?</p>
