public static string GetDllPath()
{
return System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
}
或:
public string GetDllPath()
{
return System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
}
public static string GetDllPath()
{
return System.Reflection.MethodInfo.GetCurrentMethod().ReflectedType.Module.FullyQualifiedName;
}
博客展示了获取DLL路径的代码实现,提供了三种不同的方法,均通过反射相关类来获取路径,涉及System.Reflection命名空间下的Assembly和MethodInfo等类。
737

被折叠的 条评论
为什么被折叠?



