1、获取当前exe应用程序运行路径
private string Path1 = Environment.CurrentDirectory;//末尾不带“\”
private string Path2 = Application.StartupPath;//末尾不带“\”
private string Path3 = System.IO.Directory.GetCurrentDirectory();//末尾不带“\”
private string Path4 = AppDomain.CurrentDomain.BaseDirectory;//末尾带“\”
private string Path5 = System.Threading.Thread.GetDomain().BaseDirectory;//末尾带“\”
2、获取当前exe的全路径包含exe名称
private string path = Application.ExecutablePath;
网友评论