讀寫配置檔案

2021-05-26 07:48:15 字數 1017 閱讀 4007

procedure curstepchanged(curstep: tsetupstep);

varsetupname: string;

inipath: string;

begin

case curstep of

ssinstall: //複製檔案前

begin

end;

sspostinstall:   //完成複製

begin

//將安裝程式名稱寫入配置檔案

setupname := extractfilename(expandconstant('')); 

setinistring('setup', 'name', setupname, inipath);

end;

ssdone:  //安裝完成

begin

end;

end;

end;

procedure curuninstallstepchanged(curuninstallstep: tuninstallstep);

varinipath: string;

typeregister: string;

url: string;

begin

case curuninstallstep of

usuninstall:

begin

end;

uspostuninstall:

begin

//讀取註冊資訊,生成url

typeregister := getinistring('reginfo', 'producttype', 'trial', inipath);

url := '' + typeregister;

if usingwinnt=true then

shellexec('open', url, '', '', sw_shownormal, ewnowait, errorcode);

end;

end;

end;

讀寫配置檔案

windows作業系統專門為此提供了6個api函式來對配置設定檔案進行讀 寫 getprivateprofileint 從私有初始化檔案獲取整型數值 getprivateprofilestring 從私有初始化檔案獲取字串型值 getprofileint 從win.ini 獲取整數值 getprof...

讀寫配置檔案

寫配置檔案 include include include include using std cout using std endl int main int nlen strlen d myinifile.ini 16 nlen strlen lppath 0 strcpy s lppath,s...

讀寫配置檔案

配置檔案讀寫系統方法和測試函式 include readconfig.h define cfgname test.txt void mymenu inttgetcfg char value 1024 int vlen 0 printf nplease input key scanf s,name r...