Recommended: Introduction to CreateTextFile method of FSO component object.CreateTextFile(filename[, overwrite[, unicode]]) Parameters: object Required. Should be the name of the FileSystemObject or Folder object. filename Required option. Specifies the string expression of the file to be created. overwrite Optional. Boolean value, indicating whether existing files can be overwritten. If the file can be overwritten,
If you want to get an address like this: http://192.168.0.5/super/super_article.asp?id=4
Then we just need to obtain:
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 addresses:
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 get the file name in the url and the passed value:
The ip path of this file: <%=http:// & request.servervariables(server_name)&request.servervariables(script_name) %> is fine..
Here are some other specific methods to obtain server information
Several commonly used Request.ServerVariables in Chinese
The ip path of this file: <%=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>
Niu Niu Base Server Time: <%=now%> <br>
IIS version: <%=Request.ServerVariables(SERVER_SOFTWARE)%> <br>
Script timeout: <%=Server.ScriptTimeout%> <br>
The path of this file: <%=server.mappath(Request.ServerVariables(SCRIPT_NAME))%> <br>
Number of server CPUs: <%=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>
Accessed file path: <%=Request.ServerVariables(HTTP_url)%> <br>
User agent information: <%=Request.ServerVariables(HTTP_USER_AGENT)%> <br>
Get the file name in the url and the value passed in: request.ServerVariables(script_name)+?+request.ServerVariableS(QUERY_STRING)<br>
ASP: How to get the directory where the file is located
In ASP, we all know how to get the path of the file, but we don’t know what to do if the directory where the file is located? <br>
The path to get the file is: <%=Request.ServerVariables(PATH_TRANSLATED)%><br>
Since we have all obtained the path to the file, we can use functions to process the path we just obtained, <br>
Here is our handling:
<%=Left(Request.ServerVariables(PATH_TRANSLATED), instrRev(Request.ServerVariables(PATH_TRANSLATED),))%><br>
So what is this output? It is the directory path where the file you want is located. <br>
Share: ASP's NextRecordset and GetRows methods NextRecordset and GetRows are two properties of RecordSet that are very effective in improving batch query speed. You may use very little. Let’s share the usage of these two methods: GetRows method: Extract the RecordSet record set into a two-dimensional array, and our behavior of RecordSet data is transferred to the array, so that the record set can be disconnected early without using source data.