彙編學習三 操作INI檔案

2021-04-16 23:26:27 字數 1385 閱讀 4222

;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

:filename: ini-demo.a**

;function: demo the operation of ini file

;author: purple endurer

;;log

;*************************====

;2005-05-26 created!

;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< .386

.model flat, stdcall

option casemap:none

include /ma**32/include/windows.inc

include /ma**32/include/kernel32.inc

include /ma**32/include/user32.inc

includelib /ma**32/lib/user32.lib

includelib /ma**32/lib/kernel32.lib

m_msgbox macro lpstrmsg, dwicon

invoke messagebox, null, lpstrmsg, addr g_szmsgcaption, dwicon

endm

.data

g_szmsgcaption  db  "ini demo", 0

g_szinifilespec     db  "./test.ini", 0

g_szkeyfilename db  "filename", 0

g_szkeyfilesize     db  "filesize", 0

g_szsectinfo            db  "info", 0

g_szfmt4int    db  "%s的值為%d", 0

g_szfailreadkey    db  "fail to read key!", 0

g_szfailwritestr    db  "fail to write string!", 0

g_szone db  "1", 0

.data?

g_szbuf db  256 dup (?)

invoke writeprivateprofilestring, addr g_szsectinfo, addr g_szkeyfilesize, addr g_szone, addr g_szinifilespec

.if eax==null

m_msgbox  addr g_szfailwritestr, mb_iconerror

.endif

invoke exitprocess,null

end start

ini檔案三之操作

前些天見有個問怎麼用api來實現對ini檔案的讀寫,這個問題我也早就想實現一下,可一直沒有做,現在終於又多了乙個理由來研究它了 用api寫ini檔案的函式有 bool writeprivateprofilestring lpctstr lpkeyname,鍵名 lpctstr lpstring,新增...

ini檔案操作

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

ini檔案操作

using system using system.collections.generic using system.linq using system.text using system.runtime.interopservices using system.io namespace inifi...