ini檔案操作類

2021-05-23 05:01:36 字數 852 閱讀 8077

using system;

using system.io;

using system.runtime.interopservices;

using system.text;

using system.collections;

using system.collections.specialized;

namespace cvicse.common

//讀整數

public int readinteger(string section, string ident, int default)

catch (exception ex)

}//寫整數

public void writeinteger(string section, string ident, int value)

//讀布林

public bool readbool(string section, string ident, bool default)

catch (exception ex)

}//寫bool

public void writebool(string section, string ident, bool value)

//從ini檔案中,將指定的section名稱中的所有ident新增到列表中

public void readsection(string section, stringcollection idents)

private void getstringsfrombuffer(byte buffer, int buflen, stringcollection strings)}}

}     

Ini檔案操作類

using system using system.runtime.interopservices using system.text namespace win.cfg set public inifile string path windows api 對ini檔案寫方法 要在其中寫入新字串的小...

C 類庫 ini檔案操作類

1.類庫介紹 在開發應用軟體時,ini檔案常用於軟體的相關配置,以下為ini檔案的相關結構及示例 ini檔案具有節 section 和鍵 key 兩個層級,節用 包含,然後下一行為對應鍵名以及鍵值,在示例中,info 為節,name 和 age 為鍵名,sworld 和 0 為鍵值。section ...

ini檔案操作

uses inifiles 寫入 varfilename string fileini tinifile begin filename extractfilepath paramstr 0 connect.ini fileini tinifile.create filename fileini.wr...