//load all the configuration and update the UI, //packer and sub node will share the same configuration name public void LoadPackConfig(string cfgname, bool init) { if (status == PackerStatus.RUNNING) { return; } pkg_confs.LoadConfig(cfgname); _curr_cfg.FromElement(pkg_confs.Current); foreach (byte n in weight_nodes) { if (init) { nodes_config[n] = new SqlConfig("node" + n);//new XmlConfig(ProdNum.baseDir + "\\node_" + n + ".xml"); nodes_config[n].LoadConfigFromFile(); } nodes_config[n].LoadConfig(cfgname); } if (!nodes_config.ContainsKey(vib_addr)) { if (init) { nodes_config[vib_addr] = new SqlConfig("node" + vib_addr);//new XmlConfig(ProdNum.baseDir + "\\node_" + vib_addr + ".xml"); nodes_config[vib_addr].LoadConfigFromFile(); } nodes_config[vib_addr].LoadConfig(cfgname); } if (!nodes_config.ContainsKey(bot_addr)) { if (init) { nodes_config[bot_addr] = new SqlConfig("node" + bot_addr);//new XmlConfig(ProdNum.baseDir + "\\node_" + bot_addr + ".xml"); nodes_config[bot_addr].LoadConfigFromFile(); } nodes_config[bot_addr].LoadConfig(cfgname); } //download the configuration of node settings InitSingleNodeReg(vib_addr); if (bot_addr != vib_addr) { InitSingleNodeReg(bot_addr); } foreach (byte n in weight_nodes) { InitSingleNodeReg(n); } }
private static string get_pwd(string user) { XElement x = pwds.LoadConfig(user); if (null == x) { return(pwds.GetHashCode().ToString()); //just a difficult password to guess } else { return(x.Element("sn").Value); } }