积极答复者
Assembly中GetEntryAssembly和GetExecutingAssembly的区别?

问题
-
如题目,谢谢大家,可以有一个最恰当的例子证明嘛?看了MSDN但是无法看懂,求教了,谢谢!
If you think one reply solves your problem, please mark it as An Answer, if you think someone's reply helps you, please mark it as a Proposed Answer
Help by clicking:
Click here to donate your rice to the poor
Click to Donate
Click to feed Dogs & Cats
Found any spamming-senders? Please report at: Spam Report
答案
-
hello,
请参考
http://net4.rmkrishnan.net/2013/02/reflection-assemblygetexecutingassembly.html
您可以用一个Windows Form专案试试
Console.WriteLine("Executing :" + Assembly.GetExecutingAssembly().GetName().Name.ToString()); Console.WriteLine("Calling :" + Assembly.GetCallingAssembly().GetName().Name.ToString()); Console.WriteLine("Entry :" + Assembly.GetEntryAssembly().GetName().Name.ToString());
GetExecutingAssembly:获取包含当前执行的代码的程序集
GetEntryAssembly:表示AppDomainy载入的第一个可执行党
秘訣無它,唯勤而已 http://www.dotblogs.com.tw/yc421206/
- 已标记为答案 ThankfulHeartModerator 2013年7月31日 9:03
全部回复
-
hello,
请参考
http://net4.rmkrishnan.net/2013/02/reflection-assemblygetexecutingassembly.html
您可以用一个Windows Form专案试试
Console.WriteLine("Executing :" + Assembly.GetExecutingAssembly().GetName().Name.ToString()); Console.WriteLine("Calling :" + Assembly.GetCallingAssembly().GetName().Name.ToString()); Console.WriteLine("Entry :" + Assembly.GetEntryAssembly().GetName().Name.ToString());
GetExecutingAssembly:获取包含当前执行的代码的程序集
GetEntryAssembly:表示AppDomainy载入的第一个可执行党
秘訣無它,唯勤而已 http://www.dotblogs.com.tw/yc421206/
- 已标记为答案 ThankfulHeartModerator 2013年7月31日 9:03
-
Hi 好久不见!
你的意思是说——GetEntryAssembly是一个程序入口(也就是一般是主程序)的Assembly,对吧?
If you think one reply solves your problem, please mark it as An Answer, if you think someone's reply helps you, please mark it as a Proposed Answer
Help by clicking:
Click here to donate your rice to the poor
Click to Donate
Click to feed Dogs & Cats
Found any spamming-senders? Please report at: Spam Report -
谢谢!
If you think one reply solves your problem, please mark it as An Answer, if you think someone's reply helps you, please mark it as a Proposed Answer
Help by clicking:
Click here to donate your rice to the poor
Click to Donate
Click to feed Dogs & Cats
Found any spamming-senders? Please report at: Spam Report