Environment.CurrentDirectory & System.Windows.Forms.Application.StartupPath

Sometime we can get ..\bin\Debug by using Environment.CurrentDirectory or System.Windows.Forms.Application.StartupPath. So what’s the difference?

I suggest that you use System.Windows.Forms.Application.StartupPath which can always get the path ..\bin\Debug of the current application.

for Environment.CurrentDirectory, default it is the path ..\bin\Debug of the current application, but if you  open and save currently directory frequently, maybe it will be changed.

posted on 2010-05-17 15:40  刘宁Toby  阅读(379)  评论(0编辑  收藏  举报