Datasheet
API Delphi
252
DOWNLOADS
Please refer to this forum thread for download: API_STUDIO
[4]
. The download contain all source code and the
executable (compiled for i386) of the client to test api commands.
References
[1] http:/ / www. koders. com/ delphi/ fid5A4F925F646C191A79107D11EDD80DDDF205615E. aspx?s=md5
[2] http:/ / www. ararat. cz/ synapse/ doku. php/ download
[3] http:/ / www. koders. com/ delphi/ fidDF48A5F25F06E3C6B1419E0691B806FF60260646. aspx?s=delphi
[4] http:/ / forum. mikrotik. com/ viewtopic. php?f=9& t=28821
API in C Sharp
This is C# class for connecting and working with v3.x API
Class
class MK
{
Stream connection;
TcpClient con;
public MK(string ip)
{
con = new TcpClient();
con.Connect(ip, 8728);
connection = (Stream)con.GetStream();
}
public void Close()
{
connection.Close();
con.Close();
}
public bool Login(string username, string password)
{
Send("/login", true);
string hash = Read()[0].Split(new string[] { "ret=" }, StringSplitOptions.None)[1];
Send("/login");
Send("=name=" + username);
Send("=response=00" + EncodePassword(password, hash), true);
if (Read()[0] == "!done")
{
return true;
}
else
{
return false;
}










