Community discussions

MUM Europe 2020
 
khaled11
newbie
Topic Author
Posts: 28
Joined: Mon Sep 30, 2013 7:09 pm
Location: lebanon

Problem "add new user with profile" JAVA CODE

Sun Jan 31, 2016 9:38 am

Hello
I have coded a program in java to add user and profile - mikrotik 5.26- the user added but no Profile added
help PLZ
  this.ret.sendCommand("/tool/user-manager/user/add\n=name=" + Hotspot_User_Add.this.username + "\n=password=" + Hotspot_User_Add.this.password + "\n=customer=" + "admin");
                    Thread.sleep(500L);
                    this.ret.sendCommand("/tool/user-manager/user/create-and-activate-profile\n=profile=" + Hotspot_User_Add.this.profile_choosed + "\n=customer=" + "admin" + "\n=numbers=" + Hotspot_User_Add.this.username);
                    Thread.sleep(500L);
                    this.status = true;
                  }
:D
 
legrang
just joined
Posts: 22
Joined: Wed Nov 03, 2010 4:05 pm
Location: South Africa
Contact:

Re: Problem "add new user with profile" JAVA CODE

Tue Feb 23, 2016 12:03 pm

Don't use the example code from the wiki - it's difficult to use, requires intimate knowledge of the RouterOS API and doesn't really have error handling. Rather use this library: https://github.com/GideonLeGrange/mikrotik-java. If you follow the examples in the README, you'll hopefully get further.
Gideon le Grange
RouterOS Java API: https://github.com/GideonLeGrange/mikrotik-java

Who is online

Users browsing this forum: No registered users and 16 guests