• 如何用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;
            }
  • 相关阅读:
    jsp第六周作业
    jsp第四次作业
    JSP第二次作业 2021 0310
    软件测试作业 NO.1
    北航软工优秀作业汇总
    Alpha阶段评审结果和意见反馈
    转会候选人名单
    人员转会流程
    关于团队项目阶段目标的说明
    2021年软工-热身阅读作业
  • 原文地址:https://www.cnblogs.com/syveen/p/292489.html
Copyright © 2020-2023  润新知