public Get ( string logName, int startIndex, int length ) : IList |
||
logName | string | |
startIndex | int | zero-based start |
length | int | |
return | IList |
public ActionResult Logs(string serverName) { var authres = CheckAuthorizationAndLog(Audit.AuditTypeEnum.ViewEventLog, true, serverName,"","", "view log"); if (authres != null) return authres; var el = new EventLogging(serverName, Session["Username"] as string, Session["Password"] as string); { var start = 0; var length = (el.Count("DNS Server") < 100) ? el.Count("DNS Server") : 100; ViewData["start"] = start; ViewData["length"] = length; var entries = el.Get("DNS Server", start, length); ViewData["entries"] = entries; } return View(); }
public void GetTest() { string host = Settings.Hostname; string username = Settings.Username; string password = Settings.Password; EventLogging target = new EventLogging(host, username, password); string logName = Settings.EventLogName; int startIndex = 0; int length = 5; var actual = target.Get(logName, startIndex, length); Assert.AreEqual(length, actual.Count, "Asked for 5 log events, got other"); }