ASP如何取得服务器当前路径

网络整理 - 08-30

<%
Dim SerPath, j, FullPath, FolderPath, FileName
AppName = Mid(Request.ServerVariables("SCRIPT_NAME"),(InStrRev(Request.ServerVariables("SCRIPT_NAME") ,"http://www.cuoxin.com/",-1,1))+1,Len(Request.ServerVariables("SCRIPT_NAME")))

    FullPath = Server.MapPath(AppName)
varNewPath = ""
If varNewPath <> "" Then
    If Instr(varNewPath,"") = ":" Then
    If Mid(varNewPath, 2, 1) = ":" Then  varPathx = varNewPath
    Else
    varPathx = Replace(FullPath, FileName, "")
    If Inser(Mid(varPathx, Len(varPathx) - 1, 1)) = 0 Then
    varPathx = varPathx & "\"
    End If
    End If
Else
varPathx = Replace(FullPath, FileName, "")
'varPathx = "c:\"
End If
response.write varPathx
%>