오픈소스 사용함

 

URL: https://github.com/Enichan/Ini

 

GitHub - Enichan/Ini: Ini file reader/writer for C# / .NET written in pure .NET in a single source file

Ini file reader/writer for C# / .NET written in pure .NET in a single source file - GitHub - Enichan/Ini: Ini file reader/writer for C# / .NET written in pure .NET in a single source file

github.com

 

 

Ini.cs
0.03MB

 

Kernel32를 사용하지 않고 cs파일 하나만 추가해서 매우 간단하고 직관적으로 코딩할수 있다.

 

 

            // ini 쓰기
            IniFile ini = new IniFile();
            ini["Setting"]["USE_FLAG"] = "true";
            ini["Setting"]["Delay_Time"] = "10";
            ini["INPUT_DATA"]["TEXT1"] = "DATA1";
            ini.Save("C:\\Setting.ini");
 
            // ini 읽기
            ini.Load("C:\\Setting.ini");
            string useflag = ini["Setting"]["USE_FLAG"].ToString();
            string delay_time = ini["Setting"]["Delay_Time"].ToString();
            string textdata1 = ini["INPUT_DATA"]["TEXT1"].ToString();

 

+ Recent posts