Recommended: Use VB ActiveX.dll file in ASP No one will take a more cumbersome approach to work without needing unless there is no choice. So if I'm going to tell you there is a simple technique that can make your ASP development faster and more efficient, you must be particularly interested in it. This method will transfer from most of your ASP pages to a Visual Basic Active
General FUNCTION, if the real IP cannot be obtained, it will replace the proxy IP.
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: Automatically decompress RAR files through ASP In fact, it is very simple to implement this function. First, you need to upload a RAR decompression program, which is RAR's own decompression program. You only need its core program RAR.EXE file. Then you have to upload a program that executes RAR.EXE. CMD.EXE. This is a program in Windows (no need to say more). Finally, we start executing these programs. Take a look at the following code