zoukankan      html  css  js  c++  java
  • 如何用c#获得当前站点的根路径

            public string GetRootPath()
            
    {
                
    // 是否为SSL认证站点
                string secure = HttpContext.Current.Request.ServerVariables["HTTPS"];
                
    string httpProtocol = (secure == "on" ? "https://" : "http://");

                
    // 服务器名称
                string serverName = HttpContext.Current.Request.ServerVariables["Server_Name"];
                string port = HttpContext.Current.Request.ServerVariables["SERVER_PORT"];
                   
                
    // 应用服务名称
                string applicationName = HttpContext.Current.Request.ApplicationPath;

                
    return httpProtocol + serverName + (port.Length > 0 ? ":" + port : string.Empty) + applicationName;
            }
  • 相关阅读:
    Ubuntu安装deepin wine版QQ
    解决anaconda安装cvxpy失败的方法
    1006
    一种不用参数交换两变量值的方法
    输入三位数,翻转输出
    一个简单的问题
    1006ac(转)
    1007(转)
    杭电oj1004 自写成功代码
    1004
  • 原文地址:https://www.cnblogs.com/syveen/p/292489.html
Copyright © 2011-2022 走看看