System.Reflection.Assembly.GetExecutingAssembly()。1个
Location
System.IO.Path.GetDirectoryName如果只需要目录,则将其与。
1 根据Mindor先生的评论:
System.Reflection.Assembly.GetExecutingAssembly().Location返回正在执行的程序集的当前位置,不执行时可能会或可能不在该程序集的位置。对于卷影复制程序集,您将在temp目录中获得一个路径。System.Reflection.Assembly.GetExecutingAssembly().Codebase将返回程序集的“永久”路径。



