C# 抓取程式所在路徑
C# 抓取程式所在路徑
資料來源:http://stackoverflow.com/questions/6041332/best-wa…
System.Windows.Forms.Application.StartupPath
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
資料來源:http://stackoverflow.com/questions/6041332/best-wa…
System.Windows.Forms.Application.StartupPath
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
One thought on “C# 抓取程式所在路徑”
//public static string m_StrSysPath = System.Windows.Forms.Application.StartupPath;// .net 4X - Forms
//public static string m_StrSysPath = AppDomain.CurrentDomain.BaseDirectory;// .net 4X - Console
public static string m_StrSysPath = Directory.GetCurrentDirectory()+"\\"; //通用寫法