janmohammadi / MikrotikDotNet

Mikrotik C# API - MikrotikDotNet is a lightweight and easy to use ADO.NET like library for Mikrotik Api with extensibility and performance in mind.
34 stars 13 forks source link

Count only #4

Closed tiransa closed 2 years ago

tiransa commented 6 years ago

how to get count-only ex: ip hotspot active count-only

janmohammadi commented 6 years ago

Hi Just pass count-only as a empty argument.

using (var conn = new MKConnection(IPADDRESS, USERNAME, PASSWORD))
{
    conn.Open();
    var cmd = conn.CreateCommand("ip hotspot active print");
    cmd.Parameters.Add("count-only", "");
    var count = cmd.ExecuteReaderDynamic().First().Ret;
    Console.WriteLine(count);
}
tiransa commented 6 years ago

thanks dear

On Sat, Jul 7, 2018 at 10:07 PM, Reza notifications@github.com wrote:

Hi Just pass count-only as a empty argument.

using (var conn = new MKConnection(IPADDRESS, USERNAME, PASSWORD)) { conn.Open(); var cmd = conn.CreateCommand("ip hotspot active print"); cmd.Parameters.Add("count-only", ""); var count = cmd.ExecuteReaderDynamic().First().Ret; Console.WriteLine(count); }

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/janmohammadi/MikrotikDotNet/issues/4#issuecomment-403227624, or mute the thread https://github.com/notifications/unsubscribe-auth/AMkb_FCZKZPDrkiaAayCYBX3IWv7PBh4ks5uEOPhgaJpZM4VGZ66 .