C#获取dll路径的方法(适合B/S和C/S架构)
2011-05-04 10:09
225 查看
private string GetAssemblyPath()
{
string codeBase = System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
codeBase = codeBase.Substring(8, _CodeBase.Length - 8); // 8是 file:// 的长度
string[] arrSection = codeBase.Split(new char[] { '/' });
string folderPath = "";
for (int i = 0; i < arrSection.Length - 1; i++)
{
folderPath += arrSection[i] + "/";
}
return folderPath;
}
{
string codeBase = System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
codeBase = codeBase.Substring(8, _CodeBase.Length - 8); // 8是 file:// 的长度
string[] arrSection = codeBase.Split(new char[] { '/' });
string folderPath = "";
for (int i = 0; i < arrSection.Length - 1; i++)
{
folderPath += arrSection[i] + "/";
}
return folderPath;
}
相关文章推荐
- C# 调用dll获取dll物理路径的方法
- C# 调用dll获取dll物理路径的方法
- c#调用dll获取dll物理路径的方法
- c#获取dll物理路径的方法
- c#调用dll获取dll物理路径的方法
- C#使用域进行加载dll获取方法名称被占用
- C#中获取当前路径的几种方法
- C#中获取路径的几种方法
- C#获取项目程序路径的方法
- C#获取DLL、程序路径,C#获取桌面、收藏夹等特殊系统路径
- C#中OpenFileDialog获取文件名和文件路径的常用方法
- C#获取当前路径的方法集合
- C# 获取当前路径的方法
- C# 中各种路径的获取方法
- C#获取当前路径的方法集合
- C#获取执行程序所在的当前路径的方法
- C#获取当前程序运行路径的方法集合
- asp.net C#网站项目 获取物理路径、虚拟路径的方法
- c#获取相对路径的八种方法
- C# 获取当前路径方法