發射調用System.Environment.Exit(0)示例: System.Reflection.Assembly ass = System.Reflection.Assembly.LoadFile(AppDomain.CurrentDomain.BaseDirectory+"\\xxx.dl ...
發射調用System.Environment.Exit(0)示例:
System.Reflection.Assembly ass = System.Reflection.Assembly.LoadFile(AppDomain.CurrentDomain.BaseDirectory+"\\xxx.dll");
//命名空間和類的名字必須一起指定
Type type = ass.GetType("System.Environment");
//使用16進位字元串:Type type = ass.GetType("0x53797374656d2e456e7669726f6e6d656e74");
object obj = type.InvokeMember("Exit",
System.Reflection.BindingFlags.InvokeMethod | System.Reflection.BindingFlags.Static
| System.Reflection.BindingFlags.Public, null, null,
new object[] {0}); //最後一個是參數:0
/*
object obj = type.InvokeMember("0x45786974",
System.Reflection.BindingFlags.InvokeMethod | System.Reflection.BindingFlags.Static
| System.Reflection.BindingFlags.Public, null, null,
new object[] {0});
*/
From:http://www.cnblogs.com/xuejianxiyang/p/7527228.html