如果你知道asp的虚拟目录的话,应该通过虚拟目录获得,方法如下:
Server.MapPath(虚拟目录名);

解决方案 »

  1.   

    我知道,但是dll写的时候不能用这个东西
      

  2.   

    是可以的
    首先,你通过引用System.Web.Dll
    在添加using System.Web;就行了
      

  3.   

    fileName = Path.GetFullPath("config.xml");
    System.Web.HttpServerUtility server = new HttpServerUtility() ;
    server.MapPath("config.xml");
    --------------------
    C:\Documents and Settings\libo\My Documents\Visual Studio Projects\DataIO\DataIO.cs(312): 重载“HttpServerUtility”方法未获取“0”参数
      

  4.   

    用这个:HttpContext.Current.Server.MapPath("config.xml");
      

  5.   

    能不能不用web,request.response之类的
      

  6.   

    就用
    HttpContext.Current.Server.MapPath("config.xml");