Recommended: Use ASP Trojan to implement FTP and decompression The most troublesome thing about putting a website on a broiler is to update and upload a large number of files. Terminal services are easily discovered during broad daylight, and you are not at ease when you open an ftp. I went around the Internet and found that it can be easily implemented by combining component-free uploading and asp Trojans. Asp Trojans are very familiar with everyone.
To obtain the client's real IP address through the proxy server, you must use Request.ServerVariables(HTTP_X_FORWARDED_FOR) to read it. However, it should be noted that not every proxy server can use Request.ServerVariables(HTTP_X_FORWARDED_FOR) to read the client's real IP, and some of the IPs read in this way are still the proxy server's IPs. Another thing to note is that if the client is not accessed through the proxy server, the value obtained with Request.ServerVariables (HTTP_X_FORWARDED_FOR) will be empty. Therefore, if you want to use this method in your program, you can handle it like this:
...... userip = Request.ServerVariables(HTTP_X_FORWARDED_FOR) If userip = Then userip = Request.ServerVariables(REMOTE_ADDR) ...... |
That is: if the client passes through a proxy server, it takes the value of HTTP_X_FORWARDED_FOR, and if it does not pass through a proxy server, it takes the value of REMOTE_ADDR.
'General function: If the client's real IP cannot be taken, the client's proxy IP will be taken
| Private Function getIP() Dim strIPAddr If Request.ServerVariables(HTTP_X_FORWARDED_FOR) = OR InStr(Request.ServerVariables(HTTP_X_FORWARDED_FOR), unknown) > 0 Then strIPAddr = Request.ServerVariables(REMOTE_ADDR) ElseIf InStr(Request.ServerVariables(HTTP_X_FORWARDED_FOR), ,) > 0 Then strIPAddr = Mid(Request.ServerVariables(HTTP_X_FORWARDED_FOR), 1, InStr(Request.ServerVariables(HTTP_X_FORWARDED_FOR), ,)-1) ElseIf InStr(Request.ServerVariables(HTTP_X_FORWARDED_FOR), ;) > 0 Then strIPAddr = Mid(Request.ServerVariables(HTTP_X_FORWARDED_FOR), 1, InStr(Request.ServerVariables(HTTP_X_FORWARDED_FOR), ;)-1) Else strIPAddr = Request.ServerVariables(HTTP_X_FORWARDED_FOR) End If getIP = Trim(Mid(strIPAddr, 1, 30)) End Function |
Share: ASP Advanced: Code to verify whether the ID number is correct This article is not original, but is just compiled by two or three articles. If we want to verify whether the ID number is correct, we must first understand the meaning of the ID number. What does the ID number mean? 1. The structure of the number Citizen identity number is a feature combination code, from 17