Esempio n. 1
0
        public static RouteValueDictionary EncryptRouteValueDictionary(this IEncryptString encrypter, RouteValueDictionary routeValues)
        {
            string encryptedParameters  = encrypter.Encrypt(routeValues.ToQueryString());
            RouteValueDictionary result = new RouteValueDictionary();

            result.Add("q", encryptedParameters);

            return(result);
        }
Esempio n. 2
0
        static StringEncrypter()
        {
            UrlEncrypter = new ConfigurationBasedStringEncrypter();

            ControlsEncrypter = new SessionBasedStringEncrypter();

            //string EncrypterClassName = ConfigurationManager.AppSettings["StringEncrypter"].ToString();
            //if (string.IsNullOrEmpty(EncrypterClassName))
            //    throw new InvalidOperationException("[StringEncrypter] appSettings key is not defined or has no value.");
            //Type type = Type.GetType(EncrypterClassName);
            //UrlEncrypter = (IEncryptString)Activator.CreateInstance(type);
        }
Esempio n. 3
0
 static StringEncrypter()
 {
     UrlEncrypter = new ConfigurationBasedStringEncrypter();
 }
Esempio n. 4
0
        public static RouteValueDictionary EncryptObject(this IEncryptString encrypter, object routeValues)
        {
            RouteValueDictionary parameters = HtmlHelper.AnonymousObjectToHtmlAttributes(routeValues);

            return(encrypter.EncryptRouteValueDictionary(parameters));
        }