C 讀取INI檔案

2021-06-02 04:58:10 字數 362 閱讀 5246

class inifile

public bool setint(string szsection, string szkey, int ival)

public bool setstring(string szsection, string szkey, string szval)

public uint32 getint(string szsection, string szkey, int idef)

public string getstring(string szsection, string szkey, string szdef)

}

C 讀取INI檔案

由於在c 並沒有提供專門讀取ini檔案的api,所以需要間接呼叫c 的api來進行讀取。using system using system.collections.generic using system.linq using system.text using system.io namespac...

C 讀取INI檔案

廢話不多說,直接上 1 引入命名空間 system.runtime.interopservices system.io 2 寫乙個類 inihelper public class inihelper else 寫入ini檔案 名稱 關鍵字 預設值 ini檔案位址 public static bool...

讀取INI檔案

讀取ini檔案 ini ini new ini using system using system.text using system.runtime.interopservices namespace qf public string path 引用動態連線庫方法 dllimport kernel...