Datei unter C# einlesen

private string LoadFileString()
{
	string str = "";

	char[] buf = new char[50000]; // lets define an array of type
		// char field (i.e. variable) buf
	// for more help please see .net sdk
	StreamReader sr = new StreamReader(new FileStream("html.html",
		FileMode.Open, FileAccess.Read));
	int retval = sr.ReadBlock(buf, 0, 50000); // no. of bytes read
	string filereadbuf = new string(buf); // store it in our field
	str = filereadbuf; // lets print on screen
	sr.Close();

	return str;
}