//统一处理业务 private void ProgressChanged(object o, ProgressChangedEventArgs eventArgs) { try { //调试,查看时间 watchDate.Text = anchorDateTime.ToString("an: yyyy-MM-dd HH:mm:sss") + " - " + ctDateTime.ToString("yyyy-MM-dd HH:mm:sss"); //检测到网络畅通 if (new Ping().Send("119.29.29.29", 1000).Status != IPStatus.Success) { return; } var setTime = new SetTime(); var unixBeijingTime = setTime.GetUnixBeijingTime(); //增加对比时间点更新 setTime.SetTimeFunc(unixBeijingTime); if (setTime.ifTimeDiff()) { var BlazingsBingWallpaperFullPath = Path.Combine(Environment.CurrentDirectory, "BlazingsBingWallpaper.exe"); if (File.Exists(BlazingsBingWallpaperFullPath)) { System.Diagnostics.Process.Start(BlazingsBingWallpaperFullPath); } } } catch (Exception e) { } }
public void SetTimeFuncTest() { var setTime = new SetTime(); setTime.SetTimeFunc(1564033137); }