what command to enable user ppp at API?

hii,
i got API vb from http://forum.mikrotik.com/t/api-in-visual-basic-6-working-fine/46922/1
then i custom text box.

whats command to enable ppp user?
at CLI it wil be /ppp secret enable 0
then from http://wiki.mikrotik.com/wiki/API_command_notes
i translate that CLI become
" /ppp/secret/enable
=number=0
"

why the api said its not correct command?
did i wrong?
:frowning:

You need to do this at two steps.

  1. print the “secret” entry you want enabled. To target a specific entry, use query words.
  2. From the print, extract the “.id” of the entry you want enabled, and put it in place of the “0”.

BTW, it’s “numbers”, not “number”.

did u mean like this,
/ppp/secret/print
from here i get the .id = *1

then i put
/ppp/secret/enable
=numbers=1

is thats what you want?
sorry i just implement what i get from what u said.
sorry if missunderstand what u said.

Yes, but with the star too, so

/ppp/secret/enable
=numbers=*1

i was try it too,
but this user still disable.
i was try

/ppp/secret/enable
=name=user1

but still disable..

=numbers=user1

?

Are you sure the contents of the text box is interpreted properly? Each line should be treated as a different word. The original code didn’t do that - the “one line” text field was treated as a single word. If you just changed the “one line” text field to a “multiple line” text field, that wouldn’t change the fact all contents will be interpreted as a single word.

oohh,
so thats my problem i i think.
:smiley:
i think when i change that become multiple line the command will work.
i try make comand buton and give comand

SendCommand ("/ppp/secret/enable") & vbNewLine & ("=numbers=*1")

and try

SendCommand ("/ppp/secret/enable")
SendCommand ("=numbers=*1")

but still not work.
is there another way besides array?

This VB6 API example ‘is as is’.
Analyze code, when you click ‘Send’ button command is sent with ‘End of Sentence/zero length word’ mark.
Modify this example to have possibility to send words and words with ‘End of Sentence’ separately.
api_test.JPG
As boen_robot wrote:

/ppp/secret/enable -> send this without EOS
=numbers=*1 -> send this with EOS

It works for me.

HTH,

You could alternatively modify the app to never send empty words, and send words one by one, including empty words.

That way, in the end, you’d do it like

  1. Type
/ppp/secret/enable
  1. Hit Send.
  2. Type
=numbers=*1
  1. Hit Send.
  2. Hit Send (without typing anything).

where i must download this program?

hmm..
thanks,
i still try the script..
:mrgreen: