public void Init(string path) { Iscn2tw = false; //读取配置 string tmp = MyPath.Combine(path, MyPath.GetFileName(TAG, DEXConfig.ReadString(DEXConfig.TAG_MSE))); if (!File.Exists(tmp)) { tmp = MyPath.Combine(path, MyPath.GetFileName(TAG, FILE_CONFIG_NAME)); if (!File.Exists(tmp)) { return;//如果默认的也不存在 } } SetConfig(tmp, path); }
public static void CheckVersion(bool showNew) { string newver = CheckUpdate.GetNewVersion(DEXConfig.ReadString(DEXConfig.TAG_UPDATE_URL)); if (newver == CheckUpdate.DEFAULT) { //检查失败 if (!showNew) { return; } MyMsg.Error(LMSG.CheckUpdateFail); return; } if (CheckUpdate.CheckVersion(newver, Application.ProductVersion)) {//有最新版本 if (!MyMsg.Question(LMSG.HaveNewVersion)) { return; } } else {//现在就是最新版本 if (!showNew) { return; } if (!MyMsg.Question(LMSG.NowIsNewVersion)) { return; } } //下载文件 if (CheckUpdate.DownLoad( MyPath.Combine(Application.StartupPath, newver + ".zip"))) { MyMsg.Show(LMSG.DownloadSucceed); } else { MyMsg.Show(LMSG.DownloadFail); } }