private static string FormatCookie(string cookie, bool bResolveServerName) { NetScalerDecryptedCookie decryptedCookie = DecryptNetscalerCookie.DecryptCookie(cookie, bResolveServerName); if (decryptedCookie == null) { return("Could not succesfully parse the cookie."); } StringBuilder stringBuilder = new StringBuilder(); if (!string.IsNullOrEmpty(decryptedCookie.ServiceGroupName)) { stringBuilder.AppendLine(String.Format("Service Group Name{0,2} {1}", ":", decryptedCookie.ServiceGroupName)); } if (!string.IsNullOrEmpty(decryptedCookie.ServerIP)) { stringBuilder.AppendLine(String.Format("Server IP{0,11} {1}", ":", decryptedCookie.ServerIP)); } if (!string.IsNullOrEmpty(decryptedCookie.ServerPort)) { stringBuilder.AppendLine(String.Format("Server Port{0,9} {1}", ":", decryptedCookie.ServerPort)); } if (!string.IsNullOrEmpty(decryptedCookie.ServerName)) { stringBuilder.AppendLine(String.Format("Server Name{0,9} {1}", ":", decryptedCookie.ServerName)); } return(stringBuilder.ToString()); }
public NetScalerDecryptedCookie GetInfo(string cookie) { return(DecryptNetscalerCookie.DecryptCookie(cookie, false)); }