当前目录 Bitmap(@"abc.bmp");
../ 表示回退
比如从 a文件夹页面abc.aspx到b文件页面efg.aspx
要这样Response.Redirect(@"..\b\efg.aspx");

解决方案 »

  1.   

    string bmp=GetApplicationPath()+"\\abc.bmp"; 
    public static string GetApplicationPath() 

      return Application.StartupPath; 

      

  2.   

    用System.AppDomain.CurrentDomain.BaseDirectory
    可以得到当前程序的根目录你也可以直接使用".\customer.mdb","..\customer.mdb"
    还可以使用 Application.StartUpPath来获得当前应用的所在路径 str=Path.GetExtension(Application.ExecutablePath)+"\n";
    str=str+Path.GetFileNameWithoutExtension(Application.ExecutablePath)+"\n";
    str=str+Path.GetPathRoot(Application.ExecutablePath)+"\n";
    str=str+Application.ExecutablePath+"\n";
    str=str+Path.GetDirectoryName(Application.ExecutablePath)+"\n";
    反射:
    System.Reflection.Assembly.GetExecutingAssembly().Location
      

  3.   

    Application.StartupPath 在WINFORM中
    Server.MapPath  在WEBFORM中
      

  4.   

    liduke(天下有雪) is right!
      

  5.   

    在C#里面获得应用程序的当前路径Environment.CurrentDirectory
    获取应用程序的当前工作目录。
    System.IO.Directory.GetCurrentDirectory()
    AppDomain.CurrentDomain.BaseDirectory
    Application.StartupPath
    Application.ExecutablePath
    --获取和设置当前目录(即该进程从中启动的目录)的完全限定路径。