|
本帖最后由 anythinging 于 2024-4-27 14:35 编辑
脑子实在是转不过来了,用for 加嵌套,始终弄不出来,请各位朋友指点下!
#cs ;根据变量和数值,写入ini,
如$a = 3 ,就写入3个字段,如果为0则跳过
[test1]
name = A1
port = 1
[test2]
name = A2
port = 2
[test3]
name = A3
port = 3
#ce
;傻瓜写法
Local $a = 3,$b = 2,$c = 1,$d = 0,$e = 4
IniWrite('test.ini','test1','name','A1')
IniWrite('test.ini','test1','pw',1)
IniWrite('test.ini','test2','name','A2')
IniWrite('test.ini','test2','pw',2)
IniWrite('test.ini','test3','name','A3')
IniWrite('test.ini','test3','pw',3)
IniWrite('test.ini','test4','name','B1')
IniWrite('test.ini','test4','pw',4)
IniWrite('test.ini','test5','name','B2')
IniWrite('test.ini','test5','pw',5)
IniWrite('test.ini','test6','name','C1')
IniWrite('test.ini','test6','pw',6)
IniWrite('test.ini','test7','name','E1')
IniWrite('test.ini','test7','pw',7)
IniWrite('test.ini','test8','name','E2')
IniWrite('test.ini','test8','pw',8)
IniWrite('test.ini','test9','name','E3')
IniWrite('test.ini','test9','pw',9)
IniWrite('test.ini','test10','name','E4')
IniWrite('test.ini','test10','pw',10)
|
|