
API in C Sharp
256
System.Security.Cryptography.MD5 md5;
md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
hotovo = md5.ComputeHash(heslo);
//Convert encoded bytes back to a 'readable' string
string navrat = "";
foreach (byte h in hotovo)
{
navrat += h.ToString("x2");
}
return navrat;
}
}
Example
using System.IO;
using System.Net.Sockets;
class Program
{
static void Main(string[] args)
{
MK mikrotik = new MK("your ip here");
if (!mikrotik.Login("username", "password"))
{
Console.WriteLine("Could not log in");
mikrotik.Close();
return;
}
mikrotik.Send("/system/identity/getall");
mikrotik.Send(".tag=sss", true);
foreach (string h in mikrotik.Read())
{
Console.WriteLine(h);
}
Console.ReadKey();
}
}
Commenti su questo manuale