/// <summary> /// 从ini当前路径文件中取值,并装载变量 /// </summary> public static void LoadConfig() { INIClass ic = new INIClass(System.AppDomain.CurrentDomain.BaseDirectory + "uri.ini"); #region 赋值方法 CAS_HOST = ic.IniReadValue("Hosts", "CAS_HOST"); CAS_PORT = ic.IniReadValue("Hosts", "CAS_PORT"); VPN_HOST = ic.IniReadValue("Hosts", "VPN_HOST"); VPN_PORT = ic.IniReadValue("Hosts", "VPN_PORT"); SOA_HOST = ic.IniReadValue("Hosts", "SOA_HOST"); SOA_PORT = ic.IniReadValue("Hosts", "SOA_PORT"); AUTH_HOST = ic.IniReadValue("Hosts", "AUTH_HOST"); AUTH_PORT = ic.IniReadValue("Hosts", "AUTH_PORT"); EPN_HOST = ic.IniReadValue("Hosts", "EPN_HOST"); EPN_HOST = ic.IniReadValue("Hosts", "EPN_HOST"); CAS_LOGIN = ic.IniReadValue("UriPath", "CAS_LOGIN"); CAS_LOGOUT = ic.IniReadValue("UriPath", "CAS_LOGOUT"); CAS_SGLOG = ic.IniReadValue("UriPath", "CAS_SGLOG"); EPN_LOGERR = ic.IniReadValue("UriPath", "EPN_LOGERR"); EPN_LOGIN = ic.IniReadValue("UriPath", "EPN_LOGIN"); EPN_LOGOP = ic.IniReadValue("UriPath", "EPN_LOGOP"); EPN_MAC = ic.IniReadValue("UriPath", "EPN_MAC"); EPN_APP = ic.IniReadValue("UriPath", "EPN_APP"); VPN_LOGIN = ic.IniReadValue("UriPath", "VPN_LOGIN"); SOA_FNDPW = ic.IniReadValue("UriPath", "SOA_FNDPW"); AUTH_AUTH = ic.IniReadValue("UriPath", "AUTH_AUTH"); #endregion }
private void Form1_Load(object sender, EventArgs e) { string fip = System.AppDomain.CurrentDomain.BaseDirectory + "uri.ini"; ic = new INIClass(fip); }