예제 #1
0
 private void SaveConnHist()
 {
     try
     {
         ConnHist connHist = new ConnHist(App.ConnHistFileName);
         connHist.Add(host + "::" + port);
         connHist.Save(App.ConnHistFileName);
     }
     catch (IOException)
     {
         MessageBox.Show(App.GetStr("Unable to save the history file!"),
                         App.GetStr("Error!"),
                         MessageBoxButtons.OK,
                         MessageBoxIcon.Exclamation,
                         MessageBoxDefaultButton.Button1);
     }
     catch (XmlException)
     {
         MessageBox.Show(App.GetStr("The history file is corrupted!"),
                         App.GetStr("Error!"),
                         MessageBoxButtons.OK,
                         MessageBoxIcon.Exclamation,
                         MessageBoxDefaultButton.Button1);
     }
 }
예제 #2
0
 private void LoadConnHist()
 {
     try
     {
         ConnHist connHist = new ConnHist(App.ConnHistFileName);
         for (byte i = 0; i < connHist.Count; i++)
         {
             AddConnHistEntry(connHist[i]);
         }
     }
     catch (XmlException)
     {
         MessageBox.Show(App.GetStr("The history file is corrupted."),
                         App.GetStr("Error"),
                         MessageBoxButtons.OK,
                         MessageBoxIcon.Exclamation,
                         MessageBoxDefaultButton.Button1);
     }
 }