0
のアクティブユーザーを削除します。私はコードの下でアクティブなホットスポットのユーザーを削除したいが言うホットスポット
そのような項目の下
mikrotik.Send("/ip/hotspot/active/remove");
mikrotik.Send("=.id=" + username,true);
のスクリーンショットではありません
のアクティブユーザーを削除します。私はコードの下でアクティブなホットスポットのユーザーを削除したいが言うホットスポット
そのような項目の下
mikrotik.Send("/ip/hotspot/active/remove");
mikrotik.Send("=.id=" + username,true);
のスクリーンショットではありません
これを行う最善の方法は、正しいものを見つけることです。あなたはこのようなアクティブユーザーの一覧受け取ります
/ip/hotspot/active/print
行うことによって、アクティブホットスポット利用者の.ID ...:この場合
[tag=3, data={idle-time=6s, uptime=47s, bytes-out=121490,.id=*AC100016, mac-address=2C:AE:2B:9A:22:37, packets-out=314, session-time-left=59m13s, login-by=http-chap, bytes-in=47381, address=172.16.0.22, radius=false, server=SERVER_TEST, user=0872test, packets-in=330}]
は、あなたが必要とする.IDはです.id = * AC100016
ここでは、私のメソッドの例を挙げます。deleteActiveUser()。それはJavaでやりましたが、私の意見では明らかです。
public boolean deleteActiveUser(String id_param){
boolean ret = true;
try {
StringBuilder sb = new StringBuilder();
sb.append("/ip/hotspot/active/remove .id=");
sb.append(id_param);
this.getConnection(this.mikrotik).execute(sb.toString());
} catch (MikrotikApiException e) {
ret = false;
e.printStackTrace();
} catch (NullPointerException ex) {
ex.printStackTrace();
ret = false;
} finally {
closeConnection();
}
return ret;
}