在传统的ASP PATH_INFO服务器变量的可靠性 [英] Reliability of Path_INFO server variable in classic ASP

查看:114
本文介绍了在传统的ASP PATH_INFO服务器变量的可靠性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我总是将能够使用PATH_INFO得出我的应用程序的根在下面的函数?

 函数CommonFunctions_getRoot()
    PATHINFO = Request.ServerVariables(PATH_INFO)    设置myRegExp =新的RegExp
    myRegExp.IgnoreCase = TRUE
    myRegExp.Global = TRUE
    myRegExp.Pattern =^(/ \\ W * /)。*
    CommonFunctions_getRoot = myRegExp.Replace(PATHINFO,$ 1)
最终功能


解决方案

PATH_INFO是可靠的。我能想到的唯一的问题是,如果你使用URL重写,你可能有问题。

Am I always going to be able to use PATH_INFO to derive the root of my application as in the following function?

function CommonFunctions_getRoot()


    pathinfo=Request.ServerVariables("PATH_INFO")

    Set myRegExp = New RegExp
    myRegExp.IgnoreCase = True
    myRegExp.Global = True
    myRegExp.Pattern = "^(/\w*/).*" 
    CommonFunctions_getRoot = myRegExp.Replace (pathinfo, "$1")


end function

解决方案

PATH_INFO is reliable. The only problem I can think of is that you may have issues if you use URL rewriting.

这篇关于在传统的ASP PATH_INFO服务器变量的可靠性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆