發表文章

目前顯示的是有「C#、ini」標籤的文章

Read INI file

以下的程式,是copy別人的source code, 由於copy的時候未將網站記錄下來,已經有些久遠了,在此特別註記!! 利用.ini檔可以動態的在程式中設定一些東西。可以很彈性的使用。無須客戶或是外在的一點點小改變就必須重新更新程式。以下是我的source file, 有興趣的可以參考。程式語言是用C#。 using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; public class ReadINI { [DllImport("kernel32")] private static extern long WritePrivateProfileString(string section, string key, string val, string filePath); [DllImport("kernel32")] private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath); private bool bDisposed = false; private string _FilePath = string.Empty; public string FilePath { get { if (_FilePath == null) return string.Empty; else return _FilePath; } set { if...