private void startDownload(object comm) { JConfig jc = new JConfig(data_path); switch (comm.ToString()) { case "B5": CommunityB5 b5 = new CommunityB5(this, jc.get(B5.ToString())); b5.Start(); break; case "5E": Community5E c5e = new Community5E(this, jc.get(_5E.ToString())); c5e.Start(); break; } }
private void InitConfig() { JConfig jc = new JConfig(mainForm.data_path); Config cf = jc.get(Community.ToString()); if (cf != null) { textBox_url.Text = cf.url; textBox_dir.Text = cf.path; checkBox_olny.Checked = cf.olny; checkBox_all.Checked = !cf.olny; checkBox_powerboot.Checked = cf.powerboot; checkBox_autodownload.Checked = cf.autodownload; } }
private void MainForm_Load(object sender, EventArgs e) { string conf_path = Application.StartupPath + "\\config.json"; do { if (!File.Exists(conf_path)) { //获取路径 InitForm f = new InitForm(this); f.ShowDialog(); FileStream fs = File.OpenWrite(conf_path); fs.Close(); } JConfig jc = new JConfig(conf_path); string path = jc.get("steampath"); if (path == null) { jc.set("steampath", SteamPath); } SteamPath = path; } while (SteamPath == null); }