用.NET自带的安装工具做WEB安装包,在服务器上安装好该程序,但是服务器上IIS的默认网站不在C盘,怎么才可以找到该程序所安装的物理路径(用代码实现)

解决方案 »

  1.   


    http://www.aspxboy.com/Files/71/66/286.Aspx
      

  2.   

    就是怎样才可以知道服务器IIS的路径
      

  3.   

    也可以采用以下方法获取网站根目录:UrlAuthority = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority)
    UrlAuthority & HttpContext.Current.Request.ApplicationPath
    string path ="http://" + Server.MachineName + ""
    Server.MachineName 得到服务器主机名
    string path ="http://" + Request.Url.Host.ToString + ""
    Request.Url.Host得到服务器的url