コード例 #1
0
        private static NameValueCollection CopyCollection(NameValueCollection collection)
        {
            if (collection == null || collection.Count == 0)
            {
                return(null);
            }

            try
            {
                return(new NameValueCollection(collection));
            }
            catch (HttpRequestValidationException)
            {
                return(collection.DeepClone());
            }
        }