在網上查找了不少的資料
using System;
namespace Webtest
public interface interface
int add();
}
public class ReflectTest:interface
public String Write;
private String Writec;
public String Writea
get
return Write;
}
set
Write = value;
}
}
private String Writeb
get
return Writec;
}
set
Writec = value;
}
}
public ReflectTest()
this
this
}
public ReflectTest(string str
this
this
}
public string WriteString(string s
return
}
public static string WriteName(string s)
return
}
public string WriteNoPara()
return
}
private string WritePrivate()
return
}
public int add()
return
}
}
}然後
using System;
using System
using System
class Test
delegate string TestDelegate(string value
static void Main()
//Assembly t = Assembly
Assembly t = Assembly
foreach (Type aaa in t
//Console
}
Module[] modules = t
foreach (Module module in modules)
//Console
}
Type a = typeof(Webtest
//Type a = t
//Console
string[] bb =
object obj = Activator
//object obj = t
MethodInfo[] miArr = a
foreach (MethodInfo mi
//Console
}
MethodInfo mi = a
object[] aa=
string s = (string)mi
MethodInfo mi
String[] aa
string s
MethodInfo mi
string s
MethodInfo mi
string s
//Console
PropertyInfo[] piArr = a
foreach (PropertyInfo pi in piArr)
//Console
}
PropertyInfo pi
//pi
//Console
PropertyInfo pi
pi
//Console
FieldInfo fi
//Console
ConstructorInfo[] ci
foreach (ConstructorInfo ci in ci
//Console
}
ConstructorInfo asCI = a
//Console
Webtest
Webtest
//Console
foreach (Type tt in t
if (tt
Webtest
//Console
}
}
TestDelegate method = (TestDelegate)Delegate
//動態創建委托的簡單例子
Console
Console
}
}
在這裡我把我們常用的方法
From:http://tw.wingwit.com/Article/program/net/201311/12496.html