讀配置檔案2

2021-06-08 03:41:58 字數 926 閱讀 8131

--資料--

[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 = "21,80,873,3306"

cpu = +10%

freemem = -3%

conconn = +1000

checkgw = 1

freedisk = -10%

swapused = +30000

[/host]

[host 3]

ip = 16.173.242.191

port = "21,80,873,3306"

cpu = +10%

freemem = -3%

conconn = +1000

checkgw = 1

freedisk = -10%

swapused = +30000

[/host]

--**--

my $cfg_file = "agent.txt";

sub get_config

-> = $cfg_value;}}

}close hdr;

return \%config;

}get_config();

$config-> 獲取主機1 ip的值。

讀配置檔案

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

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...

Java讀配置檔案

讀取配置檔案的方案 public string getproperty string name,string k in.close catch exception e return val 在springboot中,可以將其設定為aop的切面 注意 第乙個引數name,直接寫a.properties...