Compiler error : displaying a text file
I am using the folowing code to display the contents of a text file in a web form. I get "type or namespace definition, or end of file expected" and "{ expected". I am new to this, can some help? Thank you. Joe
namespace WebApplication8
{
/// <summary>
///
/// </summary>
public class readf
{
public readf()
{
//
// TODO: Add constructor logic here
public string ReadFromFile(string path, string fileName)
{
System.IO.StreamReader sr = File.OpenText("c:\\comcatch\\blah.txt");
String text = sr.ReadToEnd();
sr.Close();
return text;
}
}
}
}
|