>>>这个web程式所在的根虚拟目录的名称及其绝对路径
try
public class YourClass
{
  public string 虚拟目录的名称
  {
      get { return System.Web.HttpContext.Current.Request.ApplicationPath;}
  }  public string 虚拟目录绝对路径
  {
      get { return System.Web.HttpContext.Current.Request.PhysicalApplicationPath;}
  }}