If you want to get an address like this: http://192.168.0.5/super/super_article.asp?id=4
So we just need to get:
192.168.0.5---><%=request.servervariables ("http_host")%><br>
/super/super_article.asp-----><%=request.servervariables ("URL")%><br>
id=4----><%=request.servervariables ("query_string")%><br>
Then we can complete the task by combining the above address:
http://192.168.0.5/super/super_article.asp?id=4----->;http://<;%=request.servervariables ("Http_host") &request. ServerVariables ("URL") & "?" &request.servervariables ("Query_string")%><br>
Use to get the file name and the passed value in the URL:
This file IP path: <%= "http://" & Request.ServerVariables ("SERVER_NAME") &request.servervariables ("Script_name")% > It's OK.
Here are some more specific ways to get server information
Several commonly used request.servervariables in Chinese
This file IP path: <%= "http://" & Request.ServerVariables ("SERVER_NAME") &request.servervariables ("Script_name")% >
<br>
Native ip:<%=request.servervariables ("remote_addr")%> <br>
Server name: <%= Request.ServerVariables ("SERVER_NAME")%> <br>
Server Ip:<%=request.servervariables ("LOCAL_ADDR")% > <BR>
Server port: <%=request.servervariables ("Server_port")%> <br>
Niuniu Base server time: <%=now% > <br>
IIS version: <%=request.servervariables ("Server_software")%> <br>
Script timeout: <%= server.scripttimeout%> <br>
This file path: <%=server.mappath (Request.ServerVariables ("SCRIPT_NAME"))%> <BR>
Server CPU Number: <%=request.servervariables ("Number_of_processors")%> <br>
Server Interpretation engine: <%= ScriptEngine & "/" & scriptenginemajorversion& "." &ScriptEngineMinorVersion& "." & scriptenginebuildversion%> <br>
Server operating system: <%=request.servervariables ("OS")%> <br>
Supported File types: <%=request.servervariables ("http_accept")%> <br>
Access file path: <%=request.servervariables (" Http_url ")%> <br&Gt
User agent information: <%=request.servervariables ("Http_user_agent")%> <br>
Gets the file name and the value passed in the URL: Request. ServerVariables ("Script_name") + "?" +request. ServerVariables ("query_string") <br>
ASP: How to get the directory where the files are located
in ASP, we all know how to get the path of the file, but the directory where the file is located does not know how to do? <br>
The path where we get the file is: <%=request.servervariables ("path_translated")%><br>
Now that we've all got the path to the file, Then we can use the function to deal with the path we just got, <br>
Here's our deal:
<%=left (Request.ServerVariables ("path_translated"), InStrRev (Request.ServerVariables ("path_translated"), "")%><br>
So what is this output? It is the directory path where you want the file. <br>