using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using System.IO; namespace uuendused { public partial class faililugeja1 : UserControl { public faililugeja1() { InitializeComponent(); } private void nupp1_Click(object sender, RoutedEventArgs e) { string fnimi = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/tervitus.txt"; if (File.Exists(fnimi)) { MessageBox.Show(File.ReadAllText(fnimi)); } else { MessageBox.Show("Puudub fail " + fnimi); } } private void nupp2_Click(object sender, RoutedEventArgs e) { App.Current.Install(); } private void nupp3_Click(object sender, RoutedEventArgs e) { string fnimi = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/salvestusaeg.txt"; File.WriteAllText(fnimi, DateTime.Now.ToString()); MessageBox.Show("Aeg salvestati faili " + fnimi); } } }