博客园站长
这是人类成长进步中记录的每一时刻
webform
var 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 

 

posted on 2015-02-28 11:05  dm3344  阅读(342)  评论(0编辑  收藏  举报