private void SaveConfig() { XMLFile file = new XMLFile(this.getXmlPath()); file.SetConfig("ConnectionString", this.ConnectDB().DataBaseStringParam); file.SetConfig("UpdateFilePath", this.txtPath.Text.Trim()); file.SetConfig("UpdateFileVersion", this.txtFileVersion.Text.Trim()); file.SetConfig("communicationUrl", this.txtServerIp.Text.Trim()); file.SetConfig("logPath", this.txtLogPath.Text.Trim()); file.SetConfig("LogSaveDate", this.txtLogSaveDate.Text.Trim()); file.SetConfig("GlsIp", this.txtGlsIp.Text.Trim()); file.SetConfig("GlsPort", this.txtGlsPort.Text.Trim()); file.SetConfig("StandbyGlsIp", this.txtStandbyGlsIp.Text.Trim()); file.SetConfig("StandbyGlsPort", this.txtStandbyGlsPort.Text.Trim()); file.SetConfig("Port1", this.txtPort1.Text.Trim()); file.SetConfig("Port2", this.txtPort2.Text.Trim()); file.SetConfig("CorpName", this.txtCorpName.Text.Trim()); file.SetConfig("Title", this.txtTitle.Text.Trim()); file.SetConfig("Version", this.txtVer.Text.Trim()); file.SetConfig("CsFileUpdateUrl", this.txtCsUrl.Text.Trim()); //file.SetConfig("ADCUrl", this.txtWebserviceAddress.Text.Trim()); file.SetConfig("CustomInfo", this.txtCustomInfo.Text.Trim()); file.SetConfig("MapAddress", this.textMapAddr.Text.Trim()); string sMapName = this.textMapName.Text.Trim(); if (!string.IsNullOrEmpty(sMapName)) { sMapName = "maps"; } file.SetConfig("MapName", sMapName); }
private void GpsAppParamSet_Load(object sender, EventArgs e) { string str = this.getXmlPath(); XMLFile file = new XMLFile(str); XmlDocument document = new XmlDocument(); try { document.Load(str); } catch (Exception exception) { MessageBox.Show(exception.Message); return; } XmlNode node = document.SelectSingleNode("//param"); this.txtServerIp.Text = file.GetConfig(node, "communicationUrl"); this.txtPath.Text = file.GetConfig(node, "UpdateFilePath"); this.txtFileVersion.Text = file.GetConfig(node, "UpdateFileVersion"); this.txtLogPath.Text = file.GetConfig(node, "logPath"); this.txtLogSaveDate.Text = file.GetConfig(node, "LogSaveDate"); this.txtGlsIp.Text = file.GetConfig(node, "GlsIp"); this.txtGlsPort.Text = file.GetConfig(node, "GlsPort"); this.txtPort1.Text = file.GetConfig(node, "Port1"); this.txtPort2.Text = file.GetConfig(node, "Port2"); this.txtCorpName.Text = file.GetConfig(node, "CorpName"); this.txtTitle.Text = file.GetConfig(node, "Title"); //this.txtWebserviceAddress.Text = file.GetConfig(node, "ADCUrl"); this.txtVer.Text = file.GetConfig(node, "Version"); this.txtCsUrl.Text = file.GetConfig(node, "CsFileUpdateUrl"); this.txtCustomInfo.Text = file.GetConfig(node, "CustomInfo"); this.txtStandbyGlsIp.Text = file.GetConfig(node, "StandbyGlsIp"); this.txtStandbyGlsPort.Text = file.GetConfig(node, "StandbyGlsPort"); this.textMapAddr.Text = file.GetConfig(node, "MapAddress"); this.textMapName.Text = file.GetConfig(node, "MapName"); string config = file.GetConfig(node, "ConnectionString"); if (!string.IsNullOrEmpty(config)) { foreach (string str3 in config.Split(new char[] { ';' })) { string[] strArray2 = str3.Trim().Split(new char[] { '=' }); string str4 = strArray2[0].ToLower(); if (str4 != null) { if (str4 == "server") { this.txtDataSource.Text = strArray2[1]; } else if (str4 == "database") { this.txtInitialCatalog.Text = strArray2[1]; } else if (!(str4 == "uid")) { if (str4 == "pwd") { this.txtPassword.Text = strArray2[1]; } } else { this.txtUserId.Text = strArray2[1]; } } } } }