ASP에서 현재 페이지의 주소와 매개변수를 얻기 위한 함수 코드가 필요한 경우가 많습니다. 필요한 친구의 편의를 위해 특별히 구성되었습니다. 다음과 같이 코드 코드를 복사합니다.
함수 getCurrentUrl()
오류 발생 시 다음 재개
희미한 strTemp
LCase(Request.ServerVariables(HTTPS)) = 꺼진 경우 그러면
strTemp = http://
또 다른
strTemp = https://
종료 조건
strTemp = strTemp & Request.ServerVariables(SERVER_NAME)
Request.ServerVariables(SERVER_PORT) <> 80인 경우
strTemp = strTemp & : & Request.ServerVariables(SERVER_PORT)
종료하면
strTemp = strTemp & Request.ServerVariables(URL)
getCurrentUrl = strTemp
기능 종료
함수 getUrlWithParams()
희미한 스크립트 주소, 서버 이름, qs
ScriptAddress = CStr(Request.ServerVariables(SCRIPT_NAME))
서버 이름 = CStr(Request.ServerVariables(Server_Name))
qs=Request.QueryString
Request.ServerVariables(SERVER_PORT) <> 80인 경우
서버 이름 = 서버 이름 & : & Request.ServerVariables(SERVER_PORT)
종료하면
qs<>이면
getUrlWithParams =http://& 서버 이름 & 스크립트 주소 &?&qs
또 다른
getUrlWithParams =http://& 서버 이름 & 스크립트 주소
종료하면
기능 종료