讀配置檔案的實現

2021-05-23 19:42:03 字數 661 閱讀 7446

#define sas3_configfile "/mnt/heidun/config/sas3_database.conf"

getstrkeyvalue(mysqlusername,"lusername","remotemysql",sas3_configfile);//讀配置檔案

getstrkeyvalue(mysqlpassword,"lpassword","remotemysql",sas3_configfile);

getstrkeyvalue(mysqldatabaseip,"databaseip","remotemysql",sas3_configfile);

getstrkeyvalue(mysqldbname,"mysqldbname","remotemysql",sas3_configfile);

bool getstrkeyvalue(lpctstr strvalue,lpctstr strkey,lpctstr strsection,lpctstr strfilename)

strcpy(svalue,pstart);

strcpy((char *)strvalue,svalue);

fclose(fp);

return true;}}

}}break;

}}//end of if("["  "]');}}

讀配置檔案

tchar szpath max path memset szpath,0,sizeof szpath getmodulefilename null,szpath,max path cstring strpath szpath strpath strpath.left strpath.reverse...

讀配置檔案2

資料 host 1 ip 16.173.234.228 port 21,80,873,3306 cpu 10 freemem 3 conconn 1000 checkgw 1 freedisk 10 swapused 30000 host host 2 ip 16.173.235.25 port 2...

Php讀配置檔案

馬永佔,myz,mayongzhan php讀配置檔案 馬永佔,myz,mayongzhan 要讀的格式 php.ini this is demo by 馬永佔 myz global i 1j 2 k 3 self a 11 b 22 c 33 讀的方法 name test4.php date mo...