private void SaveParam() { VarGlobal.Password = this.TxtPass.Text; //VarGlobal.PrefixUserName = this.TxtPrefix.Text; VarGlobal.User = this.TxtUser.Text; if (!this.TxtAlternateURL.Text.EndsWith("/")) { this.TxtAlternateURL.Text += "/"; } VarGlobal.OpenSuseApiUrl = this.TxtAlternateURL.Text; VarGlobale.RpmSpecMPath = this.TxtRpmSpecM.Text; VarGlobale.ConfirmWarn = this.ChckConfirm.Checked; VarGlobale.AutoCheckUpdate = this.ChkUpdate.Checked; //Manage a proxy VarGlobale.ProxyEnable = this.ChkProxyEnable.Checked; VarGlobale.ProxyPassword = this.TxtProxyPass.Text; VarGlobale.ProxyPort = Convert.ToInt32(this.TxtProxyPort.Text); VarGlobale.ProxyURL = this.TxtProxyIP.Text; VarGlobale.ProxyUserName = this.TxtProxyUser.Text; VarGlobal.LessVerbose = this.ChkCkLessVerb.Checked; if (VarGlobale.ProxyEnable == true) { VarGlobal.DefineProxy(VarGlobale.ProxyURL, VarGlobale.ProxyPort, true, VarGlobale.ProxyUserName, VarGlobale.ProxyPassword); } SaveFont(); if (!File.Exists(TxtLogFs.Text)) { try { File.WriteAllText(TxtLogFs.Text, string.Empty); VarGlobal.GlobalLogFs = TxtLogFs.Text; } catch (IOException Ex) { if (!VarGlobal.LessVerbose) { Console.WriteLine("{0}{1}{1}{2}", Ex.Message, Environment.NewLine, Ex.StackTrace); } } } VarGlobale.SaveParam(); }
public static void LoadParam() { AutoCheckUpdate = Convert.ToBoolean(ConfigReaderWriter.GetXmlValue("AutoCheckUpdate", true.ToString())); //RSACSP.CreateKey = FirstRun; //VarGlobal.Password = RSACSP.DeCrypt(ConfigReaderWriter.GetXmlValue("Password", "123456789")); VarGlobal.Password = RemoveEncryption(ConfigReaderWriter.GetXmlValue("Password", "123456789")); VarGlobal.PrefixUserName = ConfigReaderWriter.GetXmlValue("PrefixUserName", "home:UserName"); VarGlobal.User = ConfigReaderWriter.GetXmlValue("User", "Your OBS Username"); VarGlobal.OpenSuseApiUrl = ConfigReaderWriter.GetXmlValue("OpenSuseApiUrl", VarGlobal.OpenSuseApiUrl); string[] SubPrjStr = ConfigReaderWriter.GetXmlValue("SubProject", VarGlobal.PrefixUserName).Split("|".ToCharArray()); RpmSpecMPath = ConfigReaderWriter.GetXmlValue("RpmSpecMPath", RpmSpecMPath); string ConfirmWarnStr = ConfigReaderWriter.GetXmlValue("ConfirmWarn", ConfirmWarn.ToString()); if (string.IsNullOrEmpty(ConfirmWarnStr) == false) { ConfirmWarn = Convert.ToBoolean(ConfirmWarnStr); } SubProject.Clear(); SubProject.AddRange(SubPrjStr); //Manage a proxy //ProxyPassword = RSACSP.DeCrypt(ConfigReaderWriter.GetXmlValue("ProxyPassword", "123456789")); ProxyEnable = Convert.ToBoolean(ConfigReaderWriter.GetXmlValue("ProxyEnable", false.ToString())); ProxyPassword = RemoveEncryption(ConfigReaderWriter.GetXmlValue("ProxyPassword", "123456789")); ProxyUserName = ConfigReaderWriter.GetXmlValue("ProxyUserName", "UserName"); ProxyURL = ConfigReaderWriter.GetXmlValue("ProxyURL", "127.0.0.1"); ProxyPort = Convert.ToInt32(ConfigReaderWriter.GetXmlValue("ProxyPort", 8080.ToString())); if (ProxyEnable == true) { VarGlobal.DefineProxy(ProxyURL, ProxyPort, true, ProxyUserName, ProxyPassword); } FirstUse = Convert.ToBoolean(ConfigReaderWriter.GetXmlValue("FirstUse", true.ToString())); VarGlobal.GlobalLogFs = ConfigReaderWriter.GetXmlValue("GlobalLogFs", PrefPath + "MonoOSC.log"); VarGlobal.LessVerbose = Convert.ToBoolean(ConfigReaderWriter.GetXmlValue("LessVerbose", true.ToString())); }