asp獲取當(dāng)前物理路徑

字號(hào):


    <%@language="vbscript"%>
    <%Option Explicit%>
    <%
    'asp獲取當(dāng)前物理路徑
    Dim foraspcnbase,foraspcnurl,foraspcntemp,foraspcntemp_array,foraspicn,foraspfactcn
    Function foraspcn()
    foraspcnbase = request.ServerVariables("APPL_PHYSICAL_PATH")'獲取當(dāng)前站點(diǎn)物理路徑
    foraspcnurl = Request.ServerVariables("SCRIPT_NAME")'獲取當(dāng)前頁(yè)面物理路徑
    foraspcntemp = Left(foraspcnbase,Len(foraspcnbase)-1) &Replace(foraspcnurl,"/","\")
    foraspcntemp_array = Split(foraspcntemp,"\")
    For foraspicn = 0 To UBound(foraspcntemp_array)-1
    foraspfactcn = foraspfactcn&foraspcntemp_array(foraspicn)&"\"
    Next
    foraspcn = foraspfactcn
    End Function
    response.write foraspcn()'輸出當(dāng)前物理路徑
    %>