public PrintParameter() { INIClass ini = new INIClass(Application.StartupPath + "\\TSconfig.ini"); background = Application.StartupPath + @"\Photo\" + ini.IniReadValue("PRINT", "BackGround"); photoPos = ini.IniReadValue("PRINT", "PhotoPos"); position = ini.IniReadValue("PRINT", "StrPos").Split('|'); }
//单例 static INIClass getInstance() { if (ini != null) { return(ini); } lock (locker) { if (ini == null) { ini = new INIClass(); } } return(ini); }
//获取指定key的value public static string getDicValue(string key) { if (ini == null) { ini = getInstance(); } if (ini.iniDic.ContainsKey(key)) { return(ini.iniDic[key]); } else { return(null); } }