API接口如何删除hotspot用户,我用的是PHP语言
$API->write('/ip/dns/static/remove', false);$API->write("=.id=" . $ip_data[".id"], true);
开发文档案例有这种源码,但这只针对id进行删除,但是hotspot的用户没有按ID删除的,我该怎么做呢??
<?php
require('./routeros.class.php');
$api=new RouterosAPI();
$api->debug=false;
if($api->connect('192.168.1.1','admin','password')){
$result=$api->comm('/ip/hotspot/user/print',array('?name'=>'zhangsan','.proplist'=>'.id'));
$api->comm('/ip/hotspot/user/remove',array('.id'=>$result['.id']));
$api->disconnect();
}
?>
页:
[1]