+ -
当前位置:首页 → 问答吧 → 求对文件目录类的操作AppDomain ,Environment相关类的操作

求对文件目录类的操作AppDomain ,Environment相关类的操作

时间:2011-12-11

来源:互联网

D:\Backup\我的文档\Visual Studio 2008\Projects\tools\tools\bin\Debug\tools.exe


如题:
  private void radioButton3_CheckedChanged(object sender, EventArgs e)
  {

  // string path = null;

  //path = AppDomain.CurrentDomain.BaseDirectory;//获取当前根目录,但是不起作用
  string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;

  Process.Start("explorer.exe", path);

使用AppDomain 来获取当前的根目录,但是我的代码来获取后,path始终指向D:\Backup\我的文档\Visual Studio 2008\Projects\tools\tools\bin\Debug\tools.exe,请高手。如:D:\Backup,

还有 我想获取其中一个文件夹的目录 应该如何操作,如:D:\Backup\我的文档\Visual Studio 2008\Projects\tools\tools或者D:\Backup\我的文档\Visual Studio 2008\Projects,此刻怎么写?谢谢各位大侠。

作者: zpzp1027   发布时间: 2011-12-11

作者: hefeng_aspnet   发布时间: 2011-12-11

我就是用的这个啊 但是获取的不对啊 ?

作者: zpzp1027   发布时间: 2011-12-11

相关阅读 更多

热门下载

更多