コード例 #1
0
 private void DealWithDownloadErrors()
 {
     try
     {
         //Test Network is OK or not.
         Config    config = Config.LoadConfig(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ConstFile.FILENAME));
         WebClient client = new WebClient();
         client.DownloadString(config.ServerUrl);
     }
     catch (Exception)
     {
         //log the error message,you can use the application's log code
         ShowErrorAndRestartApplication();
     }
 }
コード例 #2
0
 public AutoUpdater()
 {
     config = Config.LoadConfig(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ConstFile.FILENAME));
 }