- /// <summary>
- /// 获取Assembly的运行路径
- /// </summary>
- ///<returns></returns>
- 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;
- }
C# 获取应用程序物理地址(运行DLL的物理地址)
最新推荐文章于 2021-07-25 09:07:22 发布