我一直在使用C#在Windows窗體應用程序開發的瀏覽器,現在我想提出一個按鈕,存儲在文本文件的HTML代碼,我怎麼做,謝謝瀏覽器使用C#在Windows窗體應用程序
namespace browser
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button3_Click(object sender, EventArgs e)
{
browser.Refresh();
}
private void home_Click(object sender, EventArgs e)
{
browser.GoHome();
}
private void back_Click(object sender, EventArgs e)
{
if (browser.CanGoBack)
{
browser.GoBack();
}
}
private void forward_Click(object sender, EventArgs e)
{
if (browser.CanGoForward)
{
browser.GoForward();
}
}
private void stop_Click(object sender, EventArgs e)
{
browser.Stop();
}
private void go_Click(object sender, EventArgs e)
{
string url = textBox.Text.Trim();
browser.Navigate(url);
}
}
}
是否要保存該網站的html代碼? – tharif
是的,謝謝 –