delphi讀取 ini配置檔案

2021-08-09 16:28:39 字數 419 閱讀 6489

因工作需要最近開始學習delphi,可能是因為現在不熱門,網上搜好多問題和資料都搜不到或者不完全對症,整理記錄一下自己遇到的一些問題。

在.ini檔案中寫資料庫鏈結字串和一些字段,這樣一些基本資料修改起來比較方便,下面來說一下delphi中讀取.ini檔案的過程。

uses

windows, messages, sysutils, variants, classes, graphics, controls, forms,

dialogs,inifiles, db, dbaccess, ora;

中間一些**省略,下面這個procedure是具體的讀取方式:

歡迎各位程式yuan批評指正~

C 讀取ini配置檔案

using system using system.io using system.runtime.interopservices using system.text todo 在此處新增建構函式邏輯 public class iniclass 寫入ini檔案 專案名稱 如 typename 鍵 值...

MFC 讀取配置檔案ini

一.將資訊寫入.ini檔案中.1.所用的winapi函式原型為 bool writeprivateprofilestring lpctstr lpkeyname,lpctstr lpstring,lpctstr lpfilename 其中引數 lpctstr lpstring 是鍵值,也就是變數的值...

C 讀取ini配置檔案

雖然微軟早已經建議在windows中用登錄檔代替ini檔案,但是在實際應用中,ini檔案仍然有用武之地,尤其現在綠色軟體的流行,越來越多的程式將自己的一些配置資訊儲存到了ini檔案中。section key valuevc中提供了api函式進行ini檔案的讀寫操作,但是微軟推出的c 程式語言中卻沒有...