hi,
What is the c# api command to create the hotspot user?
/ip/hotspot/user/add
=name=username
=password=password
=profile=profile1
MK mikrotik = new MK("x.x.x.197");
if (!mikrotik.Login("admin", "123"))
{
MessageBox.Show("no connect");
mikrotik.Close();
return;
}
MessageBox.Show("connect");
mikrotik.Send("/ip/hotspot/user/add", false);
mikrotik.Send("=name=999", false);
mikrotik.Send("=password=999", false);
mikrotik.Send("=profile=profile1");
//MessageBox.Show("create user");
mikrotik.Close();
mikrotik.Send("=profile=profile1");
mikrotik.Read();
MK mikrotik = new MK("x.x.x.197");
if (!mikrotik.Login("admin", "123"))
{
MessageBox.Show("no connect");
mikrotik.Close();
return;
}
MessageBox.Show("connect");
mikrotik.Send("/ip/hotspot/user/add");
mikrotik.Send("=name=999");
mikrotik.Send("=password=999");
mikrotik.Send("=profile=profile1", true);
mikrotik.Read();
//MessageBox.Show("create user");
mikrotik.Close();
MikrotikApi.Send("/tool/user-manager/user/set");
MikrotikApi.Send("=name=" + username);
MikrotikApi.Send("=first-name=" + firstName);
MikrotikApi.Send("=comment=" + comment);
MikrotikApi.Send("=email=" + email);
MikrotikApi.Send("=password=" + password);
MikrotikApi.Send("=customer=admin", true);
I did it already thanks for the quick replyUse the argument "numbers" to target items. Everything else is the new value you want for that user (e.g. if you want to rename a user, you'll want "numbers" with the current username, and "name" with the new username).
The "numbers" argument I think accepts the username, but if it doesn't, you'll need to use the "print" command with a query, to get the user's ID.