VB.net API new login procedure

Hi, can someone please help me how to modify this piece of VB.Net code to make it compatible with the new API login procedure? I am using ROS 6.45.6 and I can’t figure it out. Many thanks.

Public Function Login(ByVal user As String, ByVal pass As String) As Boolean
Send(“/login”, True)
Dim hash = Read()(0).Split(New String() {“ret=”}, StringSplitOptions.None)(1)
Send(“/login”)
Send(“=name=” + user)
Send(“=response=00” + EncodePassword(pass, hash), True)
Dim res = Read()
If (res(0) = “!done”) Then Return True Else Return False
End Function
SOURCE: https://wiki.mikrotik.com/wiki/API_in_VB_dot_NET


Login method post-v6.43:

/login
=name=admin
=password=
!done

Now client sends username and password in first message.
Password is sent in plain text.
in case of error, reply contains =message=error message.
In case of successful login client can start to issue commands.

Try this:


		Send("/login")
		Send("=name=" + user)
		Send("=password=" + pass, True)

(Alternatively, use the tik4net package: http://forum.mikrotik.com/t/c-api-tik4net-on-github/90879/1)

Thank you nescafe, that worked. I owe you something!
Public Function Login(ByVal user As String, ByVal pass As String) As Boolean

Send(“/login”)
Send(“=name=” + user)
Send(“=password=” + pass, True)

Dim res = Read()
If (res(0) = “!done”) Then Return True Else Return False

End Function

Hi, I need to know, if you can help me in the new login procedure in version 6.45.7 for vb6 for api. Thank you.