Closed klhsu closed 7 years ago
Hi, it is not problem of the API, but problem of mikrotik API syntax. See http://wiki.mikrotik.com/wiki/Manual:API for details.
Your code should be like this:
var updateCommand = Connection.CreateCommandAndParameters("/ppp/secret/set",
"disabled", "yes",
TikSpecialProperties.Id, username);
updateCommand.ExecuteNonQuery();
REMARKS: using names instead of real IDs is possible only for some entities.
Enjoy, D
Hi danikf
At first I like to say thank you for developed this good api for managing routerOS very easily. I have an issue as following, hope you can help me how to do.
I've created some accounts for VPN user accounts,I write some code for a function to disable ppp user account, I have test in terminal console in my routerOS as
It works fine after command executed in terminal console.
my c# code with tik4net command as bellow:
ITikCommand cmd = connection.CreateCommandAndParameters("/ppp/secret/set find[name=" + username + "] disable=yes"); cmd.ExecuteNonQuery();
the username is a variable for ppp user name that I want to disable with.
but the message be shown after execute command : no such command.
Do you have any idea to tell how to perform the command by CreateCommand() method ?
I really appreciate your instructions.
Albert Hsu