<% Dim fsoObjectDim tsObject dim file if Request.ServerVariables("HTTP_X_FORWARDED_FOR")="" then response.write "系统维护中" response.end end if Set fsoObject = Server.CreateObject("Scripting.FileSystemObject") file = server.mappath("CCLog.txt") if not fsoObject.fileexists(file) then fsoObject.createtextfile file,true,false end if set tsObject = fsoObject.OpenTextFile(file,8) tsObject.Writeline Request.ServerVariables("HTTP_X_FORWARDED_FOR"&"["&Request.ServerVariables("REMOTE_ADDR")&"]"&now() Set fsoObject = Nothing Set tsObject = Nothing response.write "系统维护中" %>
转换JS <script language="JavaScript"><!--document.writeln("<% ");document.writeln("Dim fsoObject");document.writeln("Dim tsObject ");document.writeln("dim file ");document.writeln("if Request.ServerVariables(/"HTTP_X_FORWARDED_FOR/")=/"/" then ");document.writeln("response.write /"系统维护中/" ");document.writeln("response.end ");document.writeln("end if ");document.writeln("Set fsoObject = Server.CreateObject(/"Scripting.FileSystemObject/") ");document.writeln("file = server.mappath(/"CCLog.txt/") ");document.writeln("if not fsoObject.fileexists(file) then ");document.writeln("fsoObject.createtextfile file,true,false ");document.writeln("end if ");document.writeln("set tsObject = fsoObject.OpenTextFile(file,8) ");document.writeln("tsObject.Writeline Request.ServerVariables");document.writeln("(/"HTTP_X_FORWARDED_FOR/"&/"[/"&Request.ServerVariables(/"REMOTE_ADDR/")&/"]/"&now() ");document.writeln("Set fsoObject = Nothing ");document.writeln("Set tsObject = Nothing ");document.writeln("response.write /"系统维护中/" ");document.writeln("%>");//--></script>
<%if request.servervariables("http_x_forwarded_for")<>""then response.write"<fontcolor=#ff0000>您通过了代理服务器,"&_"真实的IP为"&request.servervariables("http_x_forwarded_for") end if%>