Code: Select all
using (var conn = ConnectionFactory.OpenConnection(TikConnectionType.ApiSsl_v2, hostip, port, admin, adminpass))
{
var cmd = conn.CreateCommand("/system/identity/print");
var result = cmd.ExecuteSingleRow();
Console.WriteLine(result.Words["name"]);
// }
// using (ITikConnection connection = ConnectionFactory.CreateConnection(TikConnectionType.ApiSsl))
// {
// connection.Open(hostip, port, admin, adminpass);
ITikCommand pppSecretCmd = conn.CreateCommand("/ppp/secret/print");
// print where name = ???
var exxx = pppSecretCmd.ExecuteList();
conn.Dispose();
pppList = ConvertToModel(exxx);
if (userName != null && userName.Length > 0)
{
pppList = pppList.Where(x => x.name == userName).ToList();
}
else
{
}
logger.Debug("get PPP User count [" + pppList.Count + "]");
}