public static void WorkThread() { while (true) { try { Bing bing = new Bing(); if (bing.Config.IsSwitch) { if (DateTime.Now.Hour >= bing.Config.DownHomeImageHouse) { if (bing.Config.DownHomeIamgeTime.ToShortDateString() != DateTime.Now.ToShortDateString()) { bing.DownHomeImg(); } } } } catch (Exception ex) { LogHelper.Error("必应工作线程异常", ex); } Thread.Sleep(60 * 60 * 1000); } }
private void CKDownBingHomeImage_CheckedChanged(object sender, EventArgs e) { Bing bing = new Bing(); bing.Config.IsSwitch = CKDownBingHomeImage.Checked; bing.SaveConfig(); }
private void buttonOpenBingHomeImageFolder_Click(object sender, EventArgs e) { Bing bing = new Bing(); System.Diagnostics.Process.Start(bing.Config.SaveHomeImagePath); }
private void MainWindow_Form_Load(object sender, EventArgs e) { Bing bing = new Bing(); CKDownBingHomeImage.Checked = bing.Config.IsSwitch; }