private void Form_otherSet_Load(object sender, EventArgs e) { if (AutoSetWall.read_ini("AUTO") == "1") { checkBox_Autochange.Checked = true; } }
private void button_setDir_Click(object sender, EventArgs e) { if (folderBrowserDialog.ShowDialog() == DialogResult.OK) { label_Dir.Text = "美图位置:" + folderBrowserDialog.SelectedPath; Program.Dir_Image = folderBrowserDialog.SelectedPath; AutoSetWall.updateAddr_ini(Program.Dir_Image); } }
private void button_ok_Click(object sender, EventArgs e) { if (checkBox_Autochange.Checked == true) { AutoSetWall.updateAuto_ini("1"); } else { AutoSetWall.updateAuto_ini("0"); } this.Close(); }
//string old_wallpaper = BackWall.GetOldWallpaper_path(); //string fileUrl = null; //string mkt; //string Dir_Image= null; public Form1() { InitializeComponent(); comboBox_Day.Text = "今天"; comboBox_Country.Text = "中国"; Program.mkt = comboBox_Country.Text; //获得国家 AutoSetWall.judge_ini(); //判断ini文件是否存在,不存在则在默认位置创建ini文件 Program.Dir_Image = AutoSetWall.read_ini("ADDR"); label_Dir.Text = "美图位置:" + Program.Dir_Image; AutoSetWall.updateExePath_ini(AutoSetWall.getRunPath()); //string aaaa = AutoSetWall.read_ini("ADDR"); //string bbbb = AutoSetWall.read_ini("AUTO"); //Console.WriteLine(aaaa); //Console.WriteLine(bbbb); }
static void Main(string[] args) { //正常执行 if (args != null) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //BackWall.GetOldWallpaper_path(); Application.Run(new Form1()); //MessageBox.Show(args); } //自动执行,自动设置壁纸 else { //Search.DownLoadImage(ImageURL, Dir_Image); string content = Search.GetBingdata("0", "ZH-CN"); Program.fileUrl = Search.GetBingImageUrl(content); int res = Search.DownLoadImage(Program.fileUrl, AutoSetWall.read_ini("ADDR")); Search.SetWallpaper(AutoSetWall.read_ini("ADDR") + "/" + Path.GetFileName(Program.fileUrl)); } }