`
邪神Saber
  • 浏览: 41160 次
文章分类
社区版块
存档分类
最新评论

获取根目录的URL 类似(http://localhost:51898)

 
阅读更多
public static string GetRootURI()
    {
        string AppPath = "";
        HttpContext HttpCurrent = HttpContext.Current;
        HttpRequest Req;
        if (HttpCurrent != null)
        {
            Req = HttpCurrent.Request;

            string UrlAuthority = Req.Url.GetLeftPart(UriPartial.Authority);
            if (Req.ApplicationPath == null || Req.ApplicationPath == "/")
                //直接安装在   Web   站点   
                AppPath = UrlAuthority;
            else
                //安装在虚拟子目录下   
                AppPath = UrlAuthority + Req.ApplicationPath;
        }
        return AppPath;
    }


分享到:
评论

相关推荐

    http://localhost:5560/isqlplus/dba 用户设置

    NULL 博文链接:https://xiaowei-qi-epro-com-cn.iteye.com/blog/1599459

    基于SpringBoot实现的一个可以在线听音乐的网站源码+数据库

    url :http://localhost:8081/user/register 用户注销 url : http://localhost:8081/user/cancel 获取用户信息 url : http://localhost:8081/user/getuser 音乐上传 url:http://localhost:8081/music/upload 删除...

    https tomcat server

    解压 apache-tomcat-6.0.30\bin\startup.bat 访问 https://localhost:8888 注意:apache-tomcat-6.0.30\conf\server ... keystorePass="123456" sslProtocol="TLS" /> keystoreFile目录

    css样式无法加载Refused to apply style from ‘http://localhost:8080/static/css/style.css’ because its MIME

    Refused to apply style from ‘http://localhost:8080/static/css/style.css’ because its MIME type (‘application/json’) is not a supported stylesheet MIME type, and strict MIME checking is enabled. ...

    Webtest(jsp).rar_Java ODBC SQLSERVER_http/2-class.com/_jsp_试卷_选择

    (4)出试卷路径为 http://localhost:8080/chap22/chujuan.jsp 如果放在根目录,则路径和书上的界面一样。 (5)选择题路径为 http://localhost:8080/chap22/xuanzeti.jsp (6)判断题路径为 ...

    获取根目录的URL例如http://localhost:51898

    主要介绍了获取根目录的URL的方法,需要的朋友可以参考下

    JSP 用户登录模块

    JSP 通用 的用户登录模块 操作步骤: 1....运行 启动Tomcat,然后在浏览器中输入http://localhost:8080/chap09/login.jsp。在文本框中输入用户名:1, 密码:1,验证码由系统自动给出。

    flowable.rar

    流程画布:http://localhost:8080/flowable-modeler 流程权限:http://localhost:8080/flowable-idm 流程监控:http://localhost:8080/flowable-admin 流程审批:http://localhost:8080/flowable-task 流程Rest API:...

    Struts2学习案例--------入门篇

    1、 URL:http://localhost:8080/struts100515/helloworld 输出Hello World 使用到struts2标签和jstl表达式 2、 URL:http://localhost:8080/struts100515 输入用户名XXX ------> 提交 ,显示 你好 XXX 使用...

    eNews新闻发布系统v1.0试用版

    安装目录只能是访问根目录下: 如:http://localhost:8080/是指向E:\myjsp这个目录,则将程序解压到:E:\myjsp目录下(注意:enews目录名不能更改,否则程序不能运行) 这样访问新闻的地址就是:...

    php网络编程技术与实例.rar

    (1)第1章所有实例的访问路径为“http://localhost/chap01/”,如访问helloworld.htm文件,可以输入如下路径:http://localhost/chap01/helloworld.htm (2)第2章所有实例的访问路径为“http://localhost/chap02/...

    URL中如果含有中文等非ASCII字符

    小结:解决方案: 1、URL中如果含有中文等非ASCII字符,则浏览器会对它们进行URLEncode。为了避免浏览器采用了我们不希望的编码,所以最好不要...URL: http://localhost:8080/example/%D6%D0%B9%FA?name=%D6%D0%B9%FA

    response_sendRedirect和request_getRequestDispatcher()_forward的区别.

    而sendRedirect方法可以让你重定向到任何URL。 表单form的action="/uu";sendRedirect("/uu");表示相对于服务器根路径。如http://localhost:8080/Test应用(则提交至http://localhost:8080/uu); Forward代码中的"/uu...

    基于Python Flask的Linux采集器,整合主机性能监控,进程监控,数据库监控和其他自定指标监控

    指标地址:http://localhost:9088/node 指标名称以node开头,支持自定义脚本指标 Process 指标 指标地址:http://localhost:9088/process 指标名以process开头,采集config/process.yaml中的指定进程状态 Db 指标 ...

    MYSQL -jsp新闻发布系统

    安装目录只能是访问根目录下: 如:http://localhost:8080/是指向E:\myjsp这个目录,则将程序解压到:E:\myjsp目录下(注意:enews目录名不能更改,否则程序不能运行) 这样访问新闻的地址就是:...

    javaweb课程设计毕业论文+SQL网上书店设计(源代码+论文)

    运行环境:jdk1.5 数据库:SQLServer2000...在IE中输入:http://localhost:8080/WSSD/ 即可打开首页 已经存在的用户:格格巫 密码:111111 http://localhost:8080/WSSD/admin/login.jsp 管理员名:admin 密码:111111

    pdfVue.zip

    下载后解压,在解压目录运行一下命令: cnpm install cnpm run dev 到浏览器: http://localhost:8080/#/pdf1/ http://localhost:8080/#/pdf2/ http://localhost:8080/#/pdf3/ http://localhost:8080/#/pdf4/

    PHP编程 源代码 光盘

    基于数据库的投票系统的目录名为“poll_1”,首先要输入“http://localhost/poll_1/createdb.php”创建数据库(记得修改config.php文件),进入管理员模块输入如下链接:http://localhost/poll_1/admin.php。...

    new-vue-system:新框架

    夜曲平台文件这里提供了...start projectnpm start启动完成后,如果一切正常,你应该能看到控制台打印如下代码: DONE Compiled successfully in 23713ms App running at: - Local: http://localhost:8080/ - Network: ...

Global site tag (gtag.js) - Google Analytics