Esempio n. 1
0
        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();
            }
        }
Esempio n. 2
0
 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();
 }
Esempio n. 3
0
 private void Window1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     File.Delete("History.temp");
     Window1 win = new Window1();
     win.Close();
 }