private static void loadStats() { try { ConfigFile configFile = new ConfigFile(Util.CONFIGPATH); Util.TOTALLOAD = Convert.ToInt64(configFile["stats.TLD"]); Util.NRUSE = Convert.ToInt32(configFile["stats.NRUSE"]); Util.TOTALSEARCH = Convert.ToInt64(configFile["stats.TSRC"]); Util.NRSEARCH = Convert.ToInt32(configFile["stats.NRSRC"]); Util.TOTALUSE = Convert.ToInt64(configFile["stats.TUSE"]); Util.startticks = DateTime.Now.Ticks; } catch (Exception) { Util.MBoxError("[email protected]()"); } }
private void button1_Click(object sender, System.EventArgs e) { if (!this.checkBox1.Checked && change) { try { Util.SHOWBUILDNEWS = false; ConfigFile configFile = new ConfigFile(Util.CONFIGPATH); configFile["1"] = "no"; configFile.Save(Util.CONFIGPATH); } catch (Exception ex) { Util.MBoxError(ex.Message, ex); } } Frst.shown = false; this.Close(); }
public static void updateRegSettings() { try { ConfigFile configFile = new ConfigFile(Util.CONFIGPATH); configFile["1"] = Util.SHOWBUILDNEWS ? "yes" : "no"; configFile["ger"] = Util.SHOWGER ? "yes" : "no"; configFile["right"] = Util.SHOWGER ? "yes" : "no"; configFile["ger"] = Util.SHOWRIGHT ? "yes" : "no"; configFile["ac"] = Util.NOCOMMIT ? "yes" : "no"; configFile["shnr"] = Util.SHOWNR ? "yes" : "no"; configFile["timer"] = Util.TIMER.ToString(); configFile["screen_id"] = Util.SCREEN_ID.ToString(); configFile["show_preview"] = Util.SHOW_PREVIEW ? "yes" : "no"; configFile["fonts.standard"] = Util.FontToString(Util.FONT); configFile["fonts.special"] = Util.FontToString(Util.SPECFONT); configFile["fonts.transfont"] = Util.FontToString(Util.TRANSFONT); configFile["fonts.color"] = Util.ColorToString(Util.COLOR); configFile["fonts.refcolor"] = Util.ColorToString(Util.REFCOLOR); configFile["fonts.refmode"] = Util.refmode ? "normal" : "fett"; configFile["presentation.unicol"] = Util.ColorToString(Util.UNICOLOR); configFile["presentation.gradcol1"] = Util.ColorToString(Util.GRADCOL1); configFile["presentation.gradcol2"] = Util.ColorToString(Util.GRADCOL2); configFile["presentation.mode"] = Util.PREMODE.ToString(); configFile["presentation.picuri"] = Util.picturi; configFile["presentation.cascade"] = Util.CASCADEPIC ? "yes" : "no"; for (int i = 0; i < Util.FX.Length; i++) { configFile["FX.f" + (i+1).ToString()] = Util.FX[i]; } configFile.Save(Util.CONFIGPATH); } catch (Exception e) { Util.MBoxError(e.Message, e); } }
public static void storeStats() { try { ConfigFile configFile = new ConfigFile(Util.CONFIGPATH); configFile["stats.TLD"] = Util.TOTALLOAD.ToString(); configFile["stats.NRUSE"] = Util.NRUSE.ToString(); configFile["stats.TSRC"] = Util.TOTALSEARCH.ToString(); configFile["stats.NRSRC"] = Util.NRSEARCH.ToString(); Util.TOTALUSE += Util.getCurrentTicks() - Util.startticks; configFile["stats.TUSE"] = Util.TOTALUSE.ToString(); configFile.Save(Util.CONFIGPATH); } catch (Exception) { Util.MBoxError("[email protected]()"); } }
public static void init() { try { ConfigFile configFile = new ConfigFile(Util.CONFIGPATH); Util.HLPURL = configFile["help"]; Util.URL = configFile["url"]; Util.LISTURL = configFile["lists"]; Util.SCHEMA = configFile["schema"]; Util.SHOWBUILDNEWS = configFile["1"].Equals("yes"); Util.SHOWRIGHT = configFile["right"].Equals("yes"); Util.NOCOMMIT = configFile["ac"].Equals("yes"); Util.SHOWGER = configFile["ger"].Equals("yes"); Util.SHOWNR = configFile["shnr"].Equals("yes"); Util.TIMER = Int32.Parse(configFile["timer"]); try { Util.SCREEN_ID = Int32.Parse(configFile["screen_id"]); View.display = Util.GetScreen(Util.SCREEN_ID); } catch(Exception) { Util.SCREEN_ID = 0; View.display = Screen.PrimaryScreen; configFile.addProperty("screen_id", "0"); configFile.Save(Util.CONFIGPATH); } if(configFile["show_preview"] == "n/a") { Util.SHOW_PREVIEW = false; configFile.addProperty("show_preview", "no"); configFile.Save(Util.CONFIGPATH); } else { Util.SHOW_PREVIEW = configFile["show_preview"] == "yes"; } Util.FONT = Util.GetFont(configFile["fonts.standard"]); Util.SPECFONT = Util.GetFont(configFile["fonts.special"]); Util.TRANSFONT = Util.GetFont(configFile["fonts.transfont"]); Util.REFCOLOR = Util.GetColor(configFile["fonts.refcolor"]); Util.COLOR = Util.GetColor(configFile["fonts.color"]); if (configFile["fonts.refmode"] == "normal") Util.refmode = true; else Util.refmode = false; Util.UNICOLOR = Util.GetColor(configFile["presentation.unicol"]); Util.GRADCOL1 = Util.GetColor(configFile["presentation.gradcol1"]); Util.GRADCOL2 = Util.GetColor(configFile["presentation.gradcol2"]); Util.PREMODE = Int32.Parse(configFile["presentation.mode"]); Util.PICTURI = configFile["presentation.picuri"]; Util.CASCADEPIC = configFile["presentation.cascade"].Equals("yes"); for (int i = 0; i < Util.FX.Length; i++) { Util.FX[i] = configFile["FX.f" + (i + 1).ToString()]; } Util.loadStats(); } catch (Exception e) { Util.MBoxError(e.Message, e); } }
private bool checkPsw() { try { ConfigFile configFile = new ConfigFile(Util.CONFIGPATH); string pw = configFile["pw"]; return pw.Equals(this.textBox1.Text); } catch (Exception e) { Util.MBoxError(e.Message, e); } return false; }
// psw setzen private void button3_Click(object sender, System.EventArgs e) { if (this.checkPsw() && this.textBox2.Text == this.textBox3.Text && this.textBox2.Text != "") { ConfigFile configFile = new ConfigFile(Util.CONFIGPATH); configFile["pw"] = this.textBox2.Text; configFile.Save(Util.CONFIGPATH); this.Height = 104; this.button1.Enabled = true; this.textBox1.Text = ""; this.textBox1.Select(); } else { Util.MBoxError("Angaben nicht korrekt!\n" + "Geben Sie bitte das alte und das neue Passwort\nan und bestätigen Sie das neue!"); } }