webformvar s = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; //C盘 IIS路径 var s1 = System.Environment.CurrentDirectory; //同上 var s2 = System.IO.Directory.GetCurrentDirectory();//同上 var s3 = System.AppDomain.CurrentDomain.BaseDirectory; //当前项目根目录 var s4 = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase; //同上
winform System.Windows.Forms.Application.StartupPath System.Windows.Forms.Application.ExecutablePath
时间: 2024-10-06 16:56:07