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(); } }
public AutoUpdater() { config = Config.LoadConfig(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ConstFile.FILENAME)); }