Beispiel #1
0
 private void CommandBinding_Save_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     HostsFileHandler.GetInstance().WriteHostsFile(TextBox.Text);
     if (HostsFileHandler.GetInstance().GetHostsAllString() == TextBox.Text)
     {
         MessageBox.Show("保存成功");
     }
     else
     {
         MessageBox.Show("保存失败");
     }
 }
Beispiel #2
0
 public MainWindow()
 {
     InitializeComponent();
     TextBox.Text = HostsFileHandler.GetInstance().GetHostsAllString();
 }