//Refjlection i C # bruker System;
< p> bruker System.Reflection ;
< p> navnerom refleksjon
< p> {
< p> klasse refleksjon
< p> {
< p> public static void main ( )
< p> {
Skriv inn t = typeof ( REFLEC );
< p> Skriv t1 = typeof (sek );
MemberInfo [ ] b = t.GetMembers ();
< p > MemberInfo [ ] c = t1.GetMembers ();
< p> foreach ( MemberInfo en i b )
< p> {
< p> Console.WriteLine ( a.ReflectedType + " " + a.DeclaringType + " " + a.Name + "= " + en .
MemberType );
< p> }
< p> foreach ( MemberInfo en i c )
< p> {
< p> Console.WriteLine ( a.ReflectedType + " " + a.DeclaringType + " " + a.Name + "=" + a.MemberType );
< p> }
< p> Console.ReadLine ();
< p> }
< p> } < br >
klasse REFLEC
< p> {
< p> public void del ( ) { }
< p> public void velkommen ( ) { }
< p> }
< p> klasse sec : REFLEC
< p> {
< p> public int a = 5;
< p> offentlig sek ( int a) { }
< p> public void cosec ( ) { }
< p> }
< p> } Anmeldelser