(Connecting)
ws_Error: Connection is forcefully rejected
its not work
his return this msg
Code: Select all(Connecting) ws_Error: Connection is forcefully rejected
ip - serviceits not work
his return this msg
Code: Select all(Connecting) ws_Error: Connection is forcefully rejected
Yes, working fine!!!is this script run correcly at v 5.12?
what wrong with mine?Yes, working fine!!!is this script run correcly at v 5.12?
@ax045Y
Do not use Package and Deployment Wizard to compile project, use VB6 IDE 'File/Make...' command instead.
In this case compiler shows you what and where is wrong with code.
This API example works fine, problem is with 'CRAM_MD5' function in 'MD5.cls'.
Remove this function and you will be able to compile this example to .EXE.
HTH,
Doris, i have your problem also, and after a hours i got thisThe script is working fine for me, the API is enabled and I can log in the router.
When I click SEND, I can see the same results. The probleme is when I click again on SEND, I get the OLD result + the new one. I cleared the text field before clicking SEND (txtout.text=""), but same problem. It seem the buffer is not clearing after the command is executed. I suspect the inbuf1 variable.
Thanks for your help
Private Sub ws_DataArrival(ByVal sent$)
.
.
.
end sub
Private Sub ws_DataArrival(ByVal bytesTotal As Long)
If bErr Then Exit Sub
Dim ar() As Byte, i&
ReDim ar(0 To bytesTotal - 1)
ws.GetData ar, vbByte, bytesTotal
On Error Resume Next
Err.Clear
On Error GoTo 0
inbuf1 = ar
Dim WordLen&, StartIdx&, Idx&
StartIdx = 0
Do While True
Idx = StartIdx
WordLen = CalcWordLen(inbuf1, Idx)
If WordLen < 0 Then
Exit Do
End If
If WordLen = 0 Then
SentenceArrived (inbuf2)
inbuf2 = ""
Else
If inbuf1(Idx) = Asc("=") Then
inbuf2 = inbuf2 & " "
End If
For i = 0 To WordLen - 1
inbuf2 = inbuf2 & Chr(inbuf1(Idx + i))
Next
End If
StartIdx = Idx + WordLen
Loop
End Sub
Private Sub SendCommand(ByVal sCmd$)
.
.
.
End Sub
Private Sub SendCommand(ByVal sCmd$)
Dim ar$(), i&, buf() As Byte
Out Replace(sCmd, " ", vbCrLf )
ar = Split(sCmd, " ")
For i = 0 To UBound(ar)
EncodeWord buf, ar(i)
Next
EncodeWord buf, ""
If ws.State = sckConnected Then ws.SendData buf
End Sub
no u can change a line white space, and read about api query here http://wiki.mikrotik.com/wiki/API#Query_word
thanks..
anyway i have new problem.
what command to enable user?
hmm,,
so this api just can do 1 line command?
no u can change a line white space, and read about api query here http://wiki.mikrotik.com/wiki/API#Query_word
thanks..
anyway i have new problem.
what command to enable user?
hmm,,
so this api just can do 1 line command?
I solved the problem:Olá,
Being ocorreno this error on the line below:
Thanks in advance!
/ip hotspot user set [/ip hotspot user find name=celular] profile=Debito
/ip hotspot user remove [/ip hotspot user find address=200.189.23.202]
/ip hotspot user
add server=hotspot name=celular password=celular address=200.189.23.202 \
mac-address=bc:85:1f:d6:ac:3e profile=1024k disabled=no comment="EDILSON SOUZA - CELULAR, 3371-5090"
thanks, i have other concerns, how i can transfer files to routeros by api?API works only over TCP, it's not possible to use API over MAC connection
Private Sub ws_DataArrival(ByVal bytesTotal As Long)
If bErr Then Exit Sub
Dim ar() As Byte, i&
ReDim ar(0 To bytesTotal - 1)
ws.GetData ar, vbByte, bytesTotal
On Error Resume Next
Err.Clear
On Error GoTo 0
inbuf1 = ar
Dim WordLen&, StartIdx&, Idx&
StartIdx = 0
Do While True
Idx = StartIdx
WordLen = CalcWordLen(inbuf1, Idx)
If WordLen < 0 Then
Exit Do
End If
If WordLen = 0 Then
SentenceArrived (inbuf2)
inbuf2 = ""
Else
If inbuf1(Idx) = Asc("=") Then
inbuf2 = inbuf2 & " "
End If
For i = 0 To WordLen - 1
inbuf2 = inbuf2 & Chr(inbuf1(Idx + i))
Next
End If
StartIdx = Idx + WordLen
Loop
End Sub
/tool/user-manager/user/print
with user manager (userman)How is the load profile in the list
SendCommand "/tool/user-manager/profile/print"
SendCommand "/ip/hotspot/profile/print"
tmp = "/login =name=" & txtUser.text & " =response=00" & tmp
tmp = "/login =name=" & txtUser.text & " =password=" & txtPass.text