public ModelSetting() { PortNames = SerialPort.GetPortNames().ToList(); SettingXML xML = new SettingXML(); xML.XmlCreate();//检测配置文件是否存在,否则生成 SqlConnectString = xML.XmlRead("SqlConnectString"); }
private void Save_Layout() { Hashtable htDB = new Hashtable(); htDB["BodyHeight"] = sBodyHH; SettingXML sXml = new SettingXML(sProgFolder + "\\" + sSettingFile); sXml.WriteXML(htDB); }
public MainWindow() { InitializeComponent(); DataContext = new ViewModelMainWindow(); FrameMainWindow.Content = new PageRealTimeData(); RbRealTimeData.IsChecked = true; SettingXML xML = new SettingXML(); xML.XmlCreate(); }
/// <summary> /// 保存配置 /// </summary> /// <param name="obj"></param> private void SaveCommandData(object obj) { SettingXML xML = new SettingXML { PortName = Model.PortName, SqlConnectString = Model.SqlConnectString }; xML.XmlSave(); }
public void Save_CompID() { // 데모용 또는, 관리용 사업자는 저장 안함. if (txtCompID.Text == "9999999999" || txtCompID.Text == "0000000000") { return; } Hashtable htDB = new Hashtable(); htDB["CompanyNo"] = txtCompID.Text; SettingXML sXml = new SettingXML(sProgFolder + "\\" + "settings_company.xml"); sXml.WriteXML(htDB); }
public void Read_CompID() { Hashtable htDB = new Hashtable(); SettingXML sXml = new SettingXML(sProgFolder + "\\" + "settings_company.xml"); htDB = sXml.ReadXml(); foreach (DictionaryEntry entry in htDB) { if (entry.Key.ToString().Equals("CompanyNo")) { txtCompID.Text = entry.Value.ToString(); } } }
private void Read_Layout() { try { Hashtable htDB = new Hashtable(); SettingXML sXml = new SettingXML(sProgFolder + "\\" + sSettingFile); htDB = sXml.ReadXml(); foreach (DictionaryEntry entry in htDB) { if (entry.Key.ToString().Equals("BodyHeight")) { sBodyHH = entry.Value.ToString(); } } } catch { } }