示例#1
0
文件: login.cs 项目: ckeyer/outmoded
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            ConfForm confform = new ConfForm();

            confform.Show(this);
            getConfig();
        }
示例#2
0
文件: login.cs 项目: ckeyer/outmoded
        private void getConfig()
        {
            XmlDocument xmlDoc = new XmlDocument();

            try
            {
                xmlDoc.Load(ConfFilePath);
                //userClient = new UserClient();
                XmlElement rootNode = xmlDoc.DocumentElement;
                XmlNode    node     = rootNode.SelectSingleNode("Server");
                userClient.serverIp   = IPAddress.Parse(node.SelectSingleNode("IPAddress").InnerText);
                userClient.serverPort = Int32.Parse(node.SelectSingleNode("Port").InnerText);
            }
            catch (Exception ex)
            {
                MessageBox.Show("加载配置文件异常");
                ConfForm confform = new ConfForm();
                confform.Show(this);
            }
        }