private void BtnNormal_Click(object sender, RoutedEventArgs e) { var button = sender as Button; ButtonHelper.SetIsWaiting(Btn1, false); ButtonHelper.SetIsWaiting(Btn2, false); ButtonHelper.SetIsWaiting(Btn3, false); ButtonHelper.SetIsWaiting(Btn4, false); switch (button.Name) { case "Btn1": ButtonHelper.SetIsWaiting(Btn1, true); break; case "Btn2": ButtonHelper.SetIsWaiting(Btn2, true); break; case "Btn3": ButtonHelper.SetIsWaiting(Btn3, true); break; case "Btn4": ButtonHelper.SetIsWaiting(Btn4, true); break; } }
/// <summary> /// 设置按钮的文字 /// </summary> /// <param name="text">按钮显示的文字</param> /// <param name="waiting">是否等待,设置为null时显示位原始状态</param> public void UpdateButton(string text, bool?waiting = null) { if (waiting.HasValue) { IsWaiting(waiting.Value); } else { IsWaiting(ButtonHelper.GetIsWaiting(LaunchButton)); } void IsWaiting(bool w) { if (w) { Dispatcher.Invoke(() => { ButtonHelper.SetWaitingContent(LaunchButton, text); ButtonHelper.SetIsWaiting(LaunchButton, true); TabItemChangeButton.IsEnabled = false; }); } else { Dispatcher.Invoke(() => { LaunchButton.Content = text; ButtonHelper.SetIsWaiting(LaunchButton, false); TabItemChangeButton.IsEnabled = true; }); } isWaiting = waiting.Value; } }
public MainWindow() { //初始化窗口 //添加程序集解析事件 this.WindowStartupLocation = WindowStartupLocation.CenterScreen; InitializeComponent(); //版本号 String stVersion = "Version - Dev.0.1.1"; Versionon.Text = stVersion; //加载颜色笔刷 SolidColorBrush mySolidColorBrush = new SolidColorBrush(); mySolidColorBrush.Color = Color.FromArgb(255, 100, 100, 100); //工具列表 Update[] listall = new Update[] { new Update() { Line = " 1 . 批量打开文件" }, new Update() { Line = " 2 . 颜色转换" }, }; UpdateList.ItemsSource = listall; //工具列表样式 this.UpdateList.Foreground = mySolidColorBrush; this.UpdateList.FontFamily = new FontFamily("方正兰亭简黑"); this.UpdateList.FontSize = 14; //版本号样式 this.Versionon.Foreground = mySolidColorBrush; this.Versionon.FontFamily = new FontFamily("方正兰亭简黑"); this.Versionon.FontSize = 12; //顶栏按钮样式 this.Feedback.Foreground = mySolidColorBrush; this.Feedback.FontFamily = new FontFamily("方正兰亭简黑"); this.Feedback.FontSize = 14; //加载主页 PageMain main = new PageMain(); Page.Content = new Frame() { Content = main }; //加载完成 ButtonHelper.SetIsWaiting(OpenButton, false); }
public Page2() { InitializeComponent(); this.Height = 477; ButtonHelper.SetIsWaiting(RunButton, false); this.Color.Fill = baseColora.Card; String stTitle = "调色板"; this.Title.Foreground = baseColora.Fg; this.Title.FontFamily = baseColora.Fonts; this.Title.FontSize = 17; Title.Text = stTitle; String stSays = "一个显示RGBA颜色的工具,并且可以转换成十六进制。"; this.Says.Foreground = baseColora.Fg; this.Says.FontFamily = baseColora.Fonts; this.Says.FontSize = 14; Says.Text = stSays; this.T1.Foreground = baseColora.Fg; this.T1.FontFamily = baseColora.Fonts; this.T1.FontSize = 13; this.T4.Foreground = baseColora.Fg; this.T4.FontFamily = baseColora.Fonts; this.T4.FontSize = 13; this.T6.Foreground = baseColora.Fg; this.T6.FontFamily = baseColora.Fonts; this.T6.FontSize = 13; this.CD1.Background = baseColora.Card; this.CD2.Background = baseColora.Card; this.J16.Background = baseColora.Bg; this.RGBA.Background = baseColora.Bg; this.J16.Foreground = baseColora.Fg; this.RGBA.Foreground = baseColora.Fg; this.Percent.Background = baseColora.DBg; this.RunCard.Background = baseColora.Card; IconHelper.SetForeground(RunButton, baseColora.Fg); IconHelper.SetForeground(ClearButton, baseColora.Fg); this.RunButton.Foreground = baseColora.Fg; this.ClearButton.Foreground = baseColora.Fg; this.RunButton.Background = baseColora.Tran; this.ClearButton.Background = baseColora.Tran; this.RunCard.Visibility = Visibility.Collapsed; this.Errorsay.Visibility = Visibility.Collapsed; ColorFst = this.Percent.Foreground; }
private void ChbWaiting_CheckChanged(object sender, RoutedEventArgs e) { if (!IsLoaded) { return; } ButtonHelper.SetIsWaiting(BtnCustom, ChbWaiting.IsChecked == true); UpdateCode(); }
private void RunFun() { ButtonHelper.SetIsWaiting(Run, true); //基本数据 string IPADRESS = nowUsed.isDHCP ? "dhcp:" + nowUsed.iP : nowUsed.iP; //自定义本机IP,DHCP请在DHCP服务器IP前加:"dhcp:" string DHCP = nowUsed.isDHCP ? "-r" : ""; //如果为DHCP请将此项改为:"-r",不是DHCP请留空:""。 string GROUPNAME = "\"" + nowUsed.teamName + "\""; //填写组名 string PASSWORD = nowUsed.teamPassword; //填写密码 string SUPERNODEIP = nowUsed.severIP; //此项为SuperNode服务器IP(公网) string SUPERNODEPORT = nowUsed.severPost.ToString(); //此项为SuperNode服务器端口 string OTHERARG = " " + nowUsed.iPAdditional; //其他参数 string APPADDRESS = Directory.GetCurrentDirectory(); //程序所在目录 //准备配置文件 string edgearg = DHCP + " -a " + IPADRESS + " -c " + GROUPNAME + " -k " + PASSWORD + " -l " + SUPERNODEIP + ":" + SUPERNODEPORT + OTHERARG; ProcessStartInfo psi = new ProcessStartInfo(); psi.FileName = "System\\edge.exe"; psi.Verb = "runas"; psi.Arguments = edgearg; psi.UseShellExecute = false; psi.CreateNoWindow = true; psi.WindowStyle = ProcessWindowStyle.Minimized; psi.RedirectStandardOutput = true; process.StartInfo = psi; process.Start(); //process. try { //监控进程 this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart) delegate() { RunInfo.Visibility = Visibility.Visible; isOpen.Text = "正在启动线程维护"; ProgressBarHelper.SetAnimateTo(openPer, 99); }); Thread thread = new Thread(Seeing); thread.Start(); } catch { this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart) delegate() { ProgressBarHelper.SetAnimateTo(openPer, 0); isOpen.Text = "未启用"; }); } }
private void RunTool(object sebder, RoutedEventArgs s) { this.RunCard.Visibility = Visibility.Visible; ProgressBarHelper.SetAnimateTo(Percent, 0); this.Errorsay.Visibility = Visibility.Collapsed; bool Error; ButtonHelper.SetIsWaiting(RunButton, true); Error = SeachFile(Address.Text); ButtonHelper.SetIsWaiting(RunButton, false); if (Error) { this.Percent.Foreground = ColorFst; ProgressBarHelper.SetAnimateTo(Percent, 100); } Error = false; }
private void LoginEventBtnClick(object sender, System.Windows.RoutedEventArgs e) { if (ButtonHelper.GetIsWaiting(this.LoginBtn)) { this.cancellationOperation = true; bw.CancelAsync();//取消后台操作 ButtonHelper.SetIsWaiting(this.LoginBtn, false); } else { ButtonHelper.SetIsWaiting(this.LoginBtn, true); } this.LoginBtn.IsEnabled = true; try { bw.RunWorkerAsync(); } catch (Exception) { //报错无视 } }
void bw_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e) { //取消后台登录 if (this.cancellationOperation) { this.cancellationOperation = false; //恢复以前状态 return; //截断 } switch (feedBack) { case 1: //登录成功 //获取新的登录信息 var userInfo = new UserInfo { AutomaticLogon = (bool)this.checkBox2.IsChecked, RememberPwd = (bool)this.checkBox1.IsChecked, UserName = AccountNmaeTxt.Text.Trim(), UserPwd = PwdTxt.Password.Trim(), }; if (!(bool)this.checkBox1.IsChecked) { userInfo.UserPwd = ""; } listUserInfo.Remove(listUserInfo.FirstOrDefault(u => u.UserName == userInfo.UserName)); listUserInfo.Insert(0, userInfo); //保存登录信息 loginInfoXmlHelper.CreateXml(listUserInfo.ToList()); HomeWindow home = new HomeWindow(); home.Show(); this.Close(); break; case 0: MessageBox.Show("登录失败!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Error); break; case -1: System.Windows.MessageBox.Show("数据库未连接!", "系统提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error); ButtonHelper.SetIsWaiting(this.LoginBtn, false); break; case -2: System.Windows.MessageBox.Show("用户名不能为空!", "系统提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information); ButtonHelper.SetIsWaiting(this.LoginBtn, false); break; case -3: System.Windows.MessageBox.Show("密码不能为空!", "系统提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information); ButtonHelper.SetIsWaiting(this.LoginBtn, false); break; case -4: System.Windows.MessageBox.Show("密码含有特殊字符!", "系统提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information); break; //case -5: // System.Windows.MessageBox.Show("用户名不正确!", "系统提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information); // break; case -6: System.Windows.MessageBox.Show("用户名或密码不正确!", "系统提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information); ButtonHelper.SetIsWaiting(this.LoginBtn, false); break; default: MessageBox.Show("未知错误!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Error); ButtonHelper.SetIsWaiting(this.LoginBtn, false); break; } }
//运行 private void RunTool(object sender, RoutedEventArgs e) { this.IconCard.Visibility = Visibility.Collapsed; ButtonHelper.SetIsWaiting(RunButton, true); if (String.IsNullOrWhiteSpace(PackageIn.Text)) { error.ErrorTo("发现错误(SOS - 001):输入为空。", Percent, Errorsay); ButtonHelper.SetIsWaiting(RunButton, false); this.RunCard.Visibility = Visibility.Visible; return; } try { string url = "https://setting.smartisan.com/app/icon"; string packageof = "[{\"package\":\"" + PackageIn.Text + "\"}]"; string GetJson = HttpUitls.Post(url, packageof, "", "application/json"); JObject obj = JObject.Parse(GetJson); JToken record = obj["body"]["app_icon"][PackageIn.Text]; JToken recorda = obj["body"]["app_icon"][PackageIn.Text]; int num = -1; int numa = 0; if (!Directory.Exists("SSTB/Files/Logo")) { Directory.CreateDirectory("SSTB/Files/Logo"); } if (!fist) { Grid grida = new Grid(); for (int i = 0; i < names.Length; i++) { grida = Iconall.FindName(names[i]) as Grid; Iconall.Children.Remove(grida); Iconall.UnregisterName(names[i]); } } fist = false; foreach (JObject jpa in recorda) { numa++; } names = new String[numa]; foreach (JObject jp in record) { num++; if (!Directory.Exists("SSTB/Files/Logo/" + num)) { Directory.CreateDirectory("SSTB/Files/Logo/" + num); } string filepath = "SSTB/Files/Logo/" + num + "/logo.png"; string filepatha = "SSTB/Files/Logo/" + num + "/md5.xml"; string filepathb = "SSTB/Files/Logo/logo" + num + ".png"; WebClient mywebclient = new WebClient(); string urlPng = jp["logo"].ToString(); string urlmd5 = jp["md5"].ToString(); mywebclient.DownloadFile(urlPng, filepath); mywebclient.DownloadFile(urlmd5, filepatha); mywebclient.DownloadFile(urlPng, filepathb); Image img = new Image(); Grid grid = new Grid(); Iconall.Children.Add(grid); grid.Children.Add(img); RegisterName("grid" + num, grid); names[num] = "grid" + num; img.Height = 256; img.Width = 540; Thickness thickness = new Thickness(); thickness.Left = 0; thickness.Top = 18; thickness.Right = 0; thickness.Bottom = 15; img.Margin = thickness; img.Source = new BitmapImage(new Uri(urlPng)); //this.T.Source = new BitmapImage(new Uri(urlPng)); } T5.Text = "原图以及MD5检验文件已保存在程序所在目录的File/Logo文件夹下"; this.IconCard.Visibility = Visibility.Visible; this.RunCard.Visibility = Visibility.Collapsed; } catch (Exception ex) { error.ErrorTo("发现错误(SOS - 003):请求图标失败, 错误原因:", "" + ex, Percent, Errorsay); this.RunCard.Visibility = Visibility.Visible; ButtonHelper.SetIsWaiting(RunButton, false); return; } ButtonHelper.SetIsWaiting(RunButton, false); }
private void RunTool(object sebder, RoutedEventArgs s) { bool Error = false; bool[] InPutHas = new bool[4]; String ErrorString = ""; int which = 0; String[] ColorList = new string[2]; ButtonHelper.SetIsWaiting(RunButton, true); this.Errorsay.Visibility = Visibility.Collapsed; this.RunCard.Visibility = Visibility.Visible; this.Percent.Foreground = ColorFst; ProgressBarHelper.SetAnimateTo(Percent, 0); for (int i = 0; i < 2; i++) { InPutHas[i] = true; } if (String.IsNullOrWhiteSpace(J16.Text)) { InPutHas[0] = false; } if (String.IsNullOrWhiteSpace(RGBA.Text)) { InPutHas[1] = false; } { bool has = false; for (int i = 0; i < 2; i++) { if (InPutHas[i] && !has) { has = true; which = i; continue; } if (InPutHas[i] && has) { Error = true; ErrorString = "发现错误(ECC - 002):有多个无法统一的输入。"; } } } if ((InPutHas[0] || InPutHas[1]) == false) { Error = true; ErrorString = "发现错误(ECC - 001):输入内容为空。"; } ProgressBarHelper.SetAnimateTo(Percent, 100 / 3); if (Error) { error.ErrorTo(ErrorString, Percent, Errorsay); } else { SolidColorBrush ChangeColor = new SolidColorBrush(); ChangeColor.Color = System.Windows.Media.Color.FromArgb(255, 209, 93, 93); switch (which + 1) { case 1: { //十六进制 ColorList[0] = this.J16.Text; int[] Color; if (this.J16.Text[0] != '#' || this.J16.Text.Length != 9) { Error = true; error.ErrorTo("发现错误(ECC - 003):输入内容无效,请检查。错误内容为……你瞎几把输入了些什么玩意。", Percent, Errorsay); break; } for (int i = 1; i <= 8; i++) { if (this.J16.Text[i] != '0' && this.J16.Text[i] != '1' && this.J16.Text[i] != '2' && this.J16.Text[i] != '3' && this.J16.Text[i] != '4' && this.J16.Text[i] != '5' && this.J16.Text[i] != '6' && this.J16.Text[i] != '7' && this.J16.Text[i] != '8' && this.J16.Text[i] != '9' && this.J16.Text[i] != 'A' && this.J16.Text[i] != 'B' && this.J16.Text[i] != 'C' && this.J16.Text[i] != 'D' && this.J16.Text[i] != 'E' && this.J16.Text[i] != 'F') { Error = true; error.ErrorTo("发现错误(ECC - 003):输入内容无效,请检查。错误内容为十六进制值大于F", Percent, Errorsay); } else { goto A; } } break; A : Color = toRGBA(this.J16.Text, 1); if (Color[4] == -1) { Error = true; break; } ColorList[1] = Color[1] + "," + Color[2] + "," + Color[3] + "," + Color[0]; ChangeColor.Color = System.Windows.Media.Color.FromArgb(byte.Parse(Color[0].ToString()), byte.Parse(Color[1].ToString()), byte.Parse(Color[2].ToString()), byte.Parse(Color[3].ToString())); SolidColorBrush CardColor = new SolidColorBrush(); if (Color[0] != 255) { CardColor.Color = System.Windows.Media.Color.FromArgb(0, 255, 255, 255); } else { CardColor.Color = System.Windows.Media.Color.FromArgb(255, 255, 255, 255); } this.ColorCard.Background = CardColor; this.Color.Fill = ChangeColor; } break; case 2: { //RGBA ColorList[1] = this.RGBA.Text; byte r, g, b, a; string[] sArray = this.RGBA.Text.Split(','); int row = sArray.GetLength(0); //第一维的长度(即行数),结果为2 if (row == 4) { if (int.Parse(sArray[0]) > 255 || int.Parse(sArray[1]) > 255 || int.Parse(sArray[2]) > 255 || int.Parse(sArray[3]) > 255) { Error = true; error.ErrorTo("发现错误(ECC - 003):输入内容无效,请检查。错误内容为RGBA值大于255。", Percent, Errorsay); break; } r = byte.Parse(sArray[0]); g = byte.Parse(sArray[1]); b = byte.Parse(sArray[2]); a = byte.Parse(sArray[3]); ChangeColor.Color = System.Windows.Media.Color.FromArgb(a, r, g, b); SolidColorBrush CardColor = new SolidColorBrush(); if (a != 255) { CardColor.Color = System.Windows.Media.Color.FromArgb(0, 255, 255, 255); } else { CardColor.Color = System.Windows.Media.Color.FromArgb(255, 255, 255, 255); } String aa = RGBATo(r, g, b, a, 1); ColorList[0] = aa.ToUpper(); this.ColorCard.Background = CardColor; this.Color.Fill = ChangeColor; } else { Error = true; error.ErrorTo("发现错误(ECC - 003):输入内容无效,请检查。错误内容为……你瞎几把输入了些什么玩意。", Percent, Errorsay); break; } } break; default: { Error = true; error.ErrorTo("发现错误(ECC - 004):在判断输入时发生未知错误,错误变量为which,数值为" + which + ",错误类型为无法匹配。", Percent, Errorsay); MessageBoxX.Show("发现错误(ECC - 004),是否反馈。", "错误", Application.Current.MainWindow); } break; } ProgressBarHelper.SetAnimateTo(Percent, 100 / 3 * 2); } ButtonHelper.SetIsWaiting(RunButton, false); this.J16.Text = ColorList[0]; this.RGBA.Text = ColorList[1]; if (!Error) { this.Errorsay.Visibility = Visibility.Collapsed; this.RunCard.Visibility = Visibility.Collapsed; this.Percent.Foreground = ColorFst; ProgressBarHelper.SetAnimateTo(Percent, 0); } Error = false; ErrorString = ""; which = 0; ColorList = new string[2]; }
private void Seeing() { if (!Directory.Exists("Cache")) { Directory.CreateDirectory("Cache"); } if (File.Exists("Cache\\logs.log")) { File.Delete("Cache\\logs.log"); } this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart) delegate() { NamePorc.Text = "加载中"; IDPorc.Text = "加载中"; UsePorc.Text = "加载中"; Ping.Text = "加载中"; }); Process p = SSUserClass.Proc.GetProc("edge"); PerformanceCounter pf1 = new PerformanceCounter("Process", "Working Set - Private", p.ProcessName); this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart) delegate() { isRun = true; ButtonHelper.SetIcon(Run, ""); IconHelper.SetFontSize(Run, 15); NamePorc.Text = p.ProcessName; IDPorc.Text = p.Id + "/" + p.SessionId; UsePorc.Text = pf1.NextValue() / 1024 + "KB"; ProgressBarHelper.SetAnimateTo(openPer, 100); isOpen.Text = "启动完成"; TaskBar.ToolTipText = "N2N Desktop Launcher - 正在运行"; taskBarRun.IsChecked = true; logTextBox.Text = ">[ 进程守护 ] 进程监控已正常运转——\n"; PingReply reply = SSUserClass.Net.GetPing(nowUsed.severIP, "abcd"); ButtonHelper.SetIsWaiting(Run, false); if (reply.Status == IPStatus.Success) { Ping.Text = (reply.RoundtripTime).ToString() + "ms"; } }); int failepingTimes = 0; int passtime = 0; while (SSUserClass.Proc.HasProc("edge")) { String nexline = process.StandardOutput.ReadLine(); if (!String.IsNullOrWhiteSpace(nexline)) { this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart) delegate() { using (StreamWriter sw = File.AppendText("Cache\\logs.log")) { sw.WriteLine(nexline); } if (nexline.IndexOf("WARNING") > 0) { logTextBox.Text += nexline + "\n"; logTextBox.Text += ">[ 进程守护 ] 发现疑似报错!\n"; } else if (nexline.IndexOf("ERROR") > 0) { logTextBox.Text += nexline + "\n"; logTextBox.Text += ">[ 进程守护 ] 发现严重错误!\n"; panErrorMsg.Visibility = Visibility.Visible; errMode = 0; errorTitle.Text = "错误"; errorSays.Text = "发现了错误:" + nexline; SSUserClass.Proc.KillProc(SSUserClass.Proc.GetProc("edge")); } else { logTextBox.Text += nexline + "\n"; } }); } if (passtime >= 30000) { passtime = 0; } if (passtime % 2000 == 0) { //刷新进程信息 try { p = SSUserClass.Proc.GetProc("edge"); pf1 = new PerformanceCounter("Process", "Working Set - Private", p.ProcessName); this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart) delegate() { NamePorc.Text = p.ProcessName; IDPorc.Text = p.Id + "/" + p.SessionId; UsePorc.Text = pf1.NextValue() / 1024 + "KB"; ProgressBarHelper.SetAnimateTo(openPer, 100); }); } catch { } //刷新Ping PingReply reply = SSUserClass.Net.GetPing(nowUsed.severIP, "abcd"); if (reply.Status == IPStatus.Success) { failepingTimes = 0; this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart) delegate() { Ping.Text = (reply.RoundtripTime).ToString() + "ms"; }); } else { failepingTimes++; if (failepingTimes >= 5) { //判定掉线重启 SSUserClass.Proc.KillProc(SSUserClass.Proc.GetProc("edge")); RunFun(); } } } passtime += 20; Thread.Sleep(20); } this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart) delegate() { RunInfo.Visibility = Visibility.Collapsed; ProgressBarHelper.SetAnimateTo(openPer, 0); isOpen.Text = "未启用"; TaskBar.ToolTipText = "N2N Desktop Launcher -未启用"; ButtonHelper.SetIcon(Run, ""); IconHelper.SetFontSize(Run, 25); taskBarRun.IsChecked = false; }); isRun = false; }
public Main() { //写入log日期 if (!Directory.Exists("SSTB/Log")) { Directory.CreateDirectory("SSTB/Log"); } if (File.Exists("SSTB/Log/log.log")) { bool[] has = new bool[3]; has[0] = has[1] = has[2] = false; if (File.Exists("SSTB/Log/log - 1.log")) { has[0] = true; } if (File.Exists("SSTB/Log/log - 2.log")) { has[1] = true; } if (File.Exists("SSTB/Log/log - 3.log")) { has[2] = true; } if (!has[0] && !has[1] && !has[2]) { File.Move("SSTB/Log/log.log", "SSTB/Log/log - 1.log"); } else if (has[0] && !has[1] && !has[2]) { File.Move("SSTB/Log/log - 1.log", "SSTB/Log/log - 2.log"); File.Move("SSTB/Log/log.log", "SSTB/Log/log - 1.log"); } else if (has[0] && has[1] && !has[2]) { File.Move("SSTB/Log/log - 2.log", "SSTB/Log/log - 3.log"); File.Move("SSTB/Log/log - 1.log", "SSTB/Log/log - 2.log"); File.Move("SSTB/Log/log.log", "SSTB/Log/log - 1.log"); } else { File.Delete("SSTB/Log/log - 3.log"); File.Move("SSTB/Log/log - 2.log", "SSTB/Log/log - 3.log"); File.Move("SSTB/Log/log - 1.log", "SSTB/Log/log - 2.log"); File.Move("SSTB/Log/log.log", "SSTB/Log/log - 1.log"); } } error.logWriter("开始加载UI", false); loadingtime = DateTime.Now; //初始化窗口 //添加程序集解析事件 this.WindowStartupLocation = WindowStartupLocation.CenterScreen; InitializeComponent(); //初始化颜色 if (!LoadingMain(true)) { Application.Current.Shutdown(); } UpdateUI(); //加载完成 error.logWriter("UI加载完成,耗时:" + (DateTime.Now - loadingtime).ToString(), false); ButtonHelper.SetIsWaiting(OpenButton, false); //检查更新 Thread thread = new Thread(UpdateRight); thread.Start(); }