private void history_Click(object sender, RoutedEventArgs e)
        {
            if (File.Exists("History.hst"))
            {

                StreamReader hist = new StreamReader("History.hst");
                StreamWriter temp2 = new StreamWriter("History.temp");
                temp2.WriteLine(hist.ReadToEnd());
                hist.Close();
                temp2.Close();
                Window1 win = new Window1();
                win.Show();

            }
            else
            {
                File.Create("history.hst");
                StreamReader hist = new StreamReader("History.hst");
                StreamWriter temp2 = new StreamWriter("History.temp");
                temp2.WriteLine(hist.ReadToEnd());
                hist.Close();
                temp2.Close();
                Window1 win = new Window1();
                win.Show();
            }
        }
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     //StreamWriter history = new StreamWriter("History.txt", true);
     //history.WriteLine(webcontrol1.Source.ToString());
     File.Delete("History.temp");
     Window1 win = new Window1();
     win.Close();
 }
示例#3
0
 private void Window1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     File.Delete("History.temp");
     Window1 win = new Window1();
     win.Close();
 }