Community discussions

MikroTik App
 
aonallah
just joined
Topic Author
Posts: 6
Joined: Thu Sep 11, 2014 2:22 am

ِAPI in C Sharp

Tue Apr 28, 2015 5:53 pm

Hiii

I use this class in c#
http://wiki.mikrotik.com/wiki/API_in_C_Sharp

I need to enable SSH and Telnet use this commend

/ip service enable ssh
/ ip service enable telnet


but I can't make the right commend ..... :(
--------------------------------------------------------------
I try this but it's not work...

mikrotik.Send("/ip/service/enable");
mikrotik.Send("=ssh", true);

----------or-----

mikrotik.Send("/ip/service/enable/ssh");

------or---------
mikrotik.Send("/ip/service");
mikrotik.Send("=ssh=enable", true);

--------or-------------
mikrotik.Send("/ip/service");
mikrotik.Send("=ssh enable", true);

----------------------


help ....
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: ِAPI in C Sharp

Tue Apr 28, 2015 6:12 pm

Try
mikrotik.Send("/ip/service/enable");
 mikrotik.Send("=numbers=ssh", true);
In general, when in doubt, go to the menu/command from terminal, and press "?" to see all possible argument names. Unnamed ones have "<" and ">" around them. Most commands on most menus use "numbers", but that's a convention, not a rule.