static void Main(string[] args) { try { var file = Path.GetFullPath(Environment.CurrentDirectory + "/../../../../sample.ini"); ScorpioIni ini = new ScorpioIni(file, Encoding.UTF8); Console.WriteLine(ini.Get("key1")); Console.WriteLine(ini.Get("sec1", "key1")); Console.WriteLine(ini.BuilderString()); } catch (Exception e) { Console.WriteLine("error : " + e.ToString()); } Console.ReadKey(); }
public static string GetConfig(PROGRAM program, string key, ConfigFile file) { ScorpioIni config = GetConfig(file); return(config.Get(program == PROGRAM.NONE ? "" : program.ToString(), key) ?? ""); }