日期:2014-05-18  浏览次数:20847 次

关于类Environment使用方法,
小弟目前在做个插件,

  private void radioButton5_CheckedChanged(object sender, EventArgs e)
  {
  string path = null;
  path = Environment.CurrentDirectory;
  Process.Start("explorer.exe", path);
  Environment.Exit(0);
  }
此时path的路径指的是D:\Backup\我的文档\Visual Studio 2008\Projects\tools\tools\bin\Debug.这个是再正常调试的模式下获取到的path是正确的。但是当我将次插件用到工具中后,此时却打开的是工程的根目录,求指教。
 

------解决方案--------------------
参见这个
http://topic.csdn.net/u/20111014/09/bd7c13c5-f332-47ab-91d2-23fde42428ac.html

System.Environment.CurrentDirectory和Application.StartupPath的区别