获取应用程序路径的区别

代码
//输出:C:\Users\Administrator\Desktop\ResFinder\ResFinder\bin\Debug
//string filepath = System.IO.Directory.GetCurrentDirectory();
   
//输出:C:\Users\Administrator\Desktop\ResFinder\ResFinder\bin\Debug\
//string filepath = AppDomain.CurrentDomain.BaseDirectory;

//输出:C:\Users\Administrator\Desktop\ResFinder\ResFinder\bin\Debug
//string filepath = Application.StartupPath;       

//输出:C:\Users\Administrator\Desktop\ResFinder\ResFinder\bin\Debug\ResFinder.exe
//string filepath = Application.ExecutablePath; 

//输出:C:\Users\Administrator\Desktop\ResFinder\ResFinder\bin\Debug\
//string filepath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;


 

原文地址:https://www.cnblogs.com/Bruce_H21/p/1954428.html