System.Web.HttpContext.Current.Server.MapPath("temp/XMLFile2.xml")

解决方案 »

  1.   

    不行呀!我的应用程序虚拟目录在e:\test:
    我用 string path=System.Web.HttpContext.Current.Server.MapPath("files/");得到的是 path="e:/test/myprog/files",而不是path="e:/test/files"。
      

  2.   

    上面写错了,改正如下:不行呀!我的应用程序虚拟目录在e:\myprog
    我用 string path=System.Web.HttpContext.Current.Server.MapPath("files/");得到的是 path="e:/myprog/files",而不是path="e:/files"。