c# html网页源代码浏览器显示
//环境VS2008,WIN7SP1
//背景:人人网自动登陆,需要把读取到的html源代码显示出来,
//test.txt 为html源代码
private void Form1_Load(object sender, EventArgs e)
{
string str = null;
StreamReader sr = new StreamReader("D:\\test.txt", Encoding.Default);
str = sr.ReadToEnd();
webBrowser1.Navigate("about:blank");
webBrowser1.Document.OpenNew(true);
webBrowser1.Document.Write(str);
}