Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Reflection;
- namespace Recetas.Cap03
- {
- public sealed class UsoGetProperties
- {
- public static void Main()
- {
- // Arreglo con elementos `PropertyInfo`:
- PropertyInfo[] propiedades;
- // Obtiene las propiedades de `Type`:
- propiedades = Type.GetType("System.Type").GetProperties();
- // Resultado:
- Console.WriteLine ("\nPropiedades de `{0}`:\n", Type.GetType("System.Type").Name.ToString());
- foreach (PropertyInfo propiedad in propiedades)
- {
- Console.WriteLine ("\tPropiedad: {0}", propiedad.ToString());
- }
- Console.WriteLine ();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement