请选择 进入手机版 | 继续访问电脑版

UBAINS

 找回密码
 立即注册
搜索
热搜: UBAINS
查看: 1188|回复: 0

[软件设置] 如何在控制主机FTP上读写配置参数

[复制链接]

68

主题

72

帖子

661

积分

公司员工

积分
661
发表于 2018-12-5 11:38:20 | 显示全部楼层 |阅读模式
本帖最后由 zhengxb 于 2019-6-28 09:49 编辑

当需要实现配置选项时,在FTP上配置相关的选项,无需要在程序上修改
TCP连接端口号,9999 命令采用JSON格式,中文编码为GBK{"cmd":"system","action":"getuserini","group":"Telcom","item":"address1"}


用户文件:
文件路径:
ftp://IP地址/System/User/Custom.ini
文件内容:
[Telcom]
address1 = {"name":"lishi","number":135000000000}
address2 = {"name":"张三","number":18100000000}

读取指令:{"cmd":"system","action":"getuserini","group":"Telcom","item":"address1"}
group 为:[Telcom]i
tem为:address1

返加值:{"cmd":"system","action":"getuserini","group":"Telcom","item":"address1","value":"{\"name\":\"lishi\",\"number\":135000000000}"}
value为对应item等号后面的值

修改指令:{"cmd":"system","action":"setuserini","group":"Telcom","item":"address1","value":"abcdefg"}
group 为:[Telcom]i
tem为:address1
value为对应需要修改的值

返加值:{"cmd":"system","action":"setuserini","group":"Telcom","item":"address1","value":"abcdefg"}
value为对应item等号后面的值

如配置文件无对应item,则会自动增加
获取整个文件内容:  固件: 20180329
{"cmd":"system","action":"getuserfile","format":"json","filename":"Custom.ini"}
{"cmd":"system","action":"getuserfile","format":"file","filename":"Custom.ini"}
format:为json则以JSON格式输出,为file为整个文件输出





高级模式
B Color Image Link Quote Code Smilies |上传

本版积分规则

Archiver|手机版|小黑屋|BBS.UBAINSYUN.COM

GMT+8, 2021-7-30 18:23 , Processed in 0.038888 second(s), 18 queries .

Powered by UBAINS! X3.4

© 2001-2017 UBAINS Inc.

快速回复 返回顶部 返回列表