Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
 public NetScalerDecryptedCookie GetInfo(string cookie)
 {
     return(DecryptNetscalerCookie.DecryptCookie(cookie, false));
 }