我如何获取我的.exe路径,因为如果我复制.exe可以获取我的新路径?
4 回答
月关宝盒
TA贡献1772条经验 获得超5个赞
此外:
AppDomain.CurrentDomain.BaseDirectory
Assembly.GetEntryAssembly().Location
慕桂英546537
TA贡献1848条经验 获得超10个赞
在Windows窗体项目中:
对于完整路径(包括文件名):string exePath = Application.ExecutablePath;
仅对于路径:string appPath = Application.StartupPath;
慕的地10843
TA贡献1785条经验 获得超8个赞
在visualstudio 2008中,您可以使用以下代码:
var _assembly = System.Reflection.Assembly
.GetExecutingAssembly().GetName().CodeBase;
var _path = System.IO.Path.GetDirectoryName(_assembly) ;
- 4 回答
- 0 关注
- 257 浏览
添加回答
举报
0/150
提交
取消