如何在Windows窗体应用程序中获取应用程序物理路径
问题描述:
如何在Windows窗体中获取应用程序路径,我使用了下面的代码,但它说的是找不到方法"
how to get the application path in windows forms , i used the bellow code but it is saying like "method not found"
Application.ExecutablePath;
Application.StartupPath;
请建议我是否缺少任何名称空间?
please suggest me am i missing any namespace ?
预先感谢
答
这将返回您的应用程序的完整路径
This will return the complete path to your Application
System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)