Пример #1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            string   strConfigName = "WebLink.ini";
            string   strConfigPath = Path.Combine(Application.StartupPath, strConfigName);
            IniClass ini           = new SmartClient.IniClass(strConfigPath);

            this.txtAddress.Text = ini.ReadValue("Link", "server");
            this.txtPort.Text    = ini.ReadValue("Link", "port");
        }
Пример #2
0
        /// <summary>
        /// 读取配置文件
        /// </summary>
        /// <param name="strServer"></param>
        /// <param name="strPort"></param>
        internal static void ReadConfigFile(out string strServer, out string strPort)
        {
            strServer = "";
            strPort   = "";
            string strConfigPath = Path.Combine(Application.StartupPath, ServerConfig.ConfigName);

            if (File.Exists(strConfigPath))
            {
                IniClass ini = new SmartClient.IniClass(strConfigPath);
                strServer = ini.ReadValue("Link", "server");
                strPort   = ini.ReadValue("Link", "port");
            }
        }