1. 程式人生 > >C#獲取應用程序路徑

C#獲取應用程序路徑

pro 應用 startup style sem windows orm getent app

            string s = Environment.CurrentDirectory;
            //需添加Forms.DLL
            s = System.Windows.Forms.Application.StartupPath;
            s = System.Windows.Forms.Application.ExecutablePath;


            s = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
            s 
= System.Reflection.Assembly.GetEntryAssembly().Location;

C#獲取應用程序路徑