コード例 #1
0
        public static void ValidateValue(NameValueCollection formValues, string name)
        {
            var value = formValues[name];
            var hash  = formValues[SecuredValueFieldNameComputer.GetSecuredValueFieldName(name)];

            ValidateValue(value, hash);
        }
コード例 #2
0
        public static void ValidateMultipleValues(NameValueCollection formValues, string name, IEnumerable <string> names)
        {
            var valueToHash = new StringBuilder();

            foreach (var n in names)
            {
                valueToHash.Append(formValues[n]);
            }
            ValidateValue(valueToHash.ToString(), formValues[SecuredValueFieldNameComputer.GetSecuredValueFieldName(name)]);
        }
コード例 #3
0
 private static HtmlString GetHashFieldHtml(HtmlHelper htmlHelper, string name, string value)
 {
     return(htmlHelper.Hidden(SecuredValueFieldNameComputer.GetSecuredValueFieldName(name), SecuredValueHashComputer.GetHash(value)));
 }