コード例 #1
0
 /// <summary>
 /// Marca somente leitura para a lista de QueryString.
 /// </summary>
 /// <param name="collection"></param>
 public static void MakeReadOnlyCollection(System.Collections.Specialized.NameValueCollection collection)
 {
     if (collection == null)
     {
         throw new ArgumentNullException("collection");
     }
     System.Reflection.MethodInfo mi = collection.GetType().GetMethod("MakeReadOnly", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
     mi.Invoke(collection, null);
 }