Display IP, version, login time, number of visits created by flash combined with asp
Author:Eve Cole
Update Time:2009-06-23 17:00:41
I don’t know if it’s original or not, but I made it myself without referring to anything. First, you need 2 asp files, 1 text file, and 1 swf file.
------------------info.asp-----------------------------
//Here is the display of IP, version and login time<!--#include file="num.asp"-->
<%
set userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If userip = "" Then userip = Request.ServerVariables("REMOTE_ADDR")
response.write("&t0=Your IP address is:"&userip)
set ie=Request.ServerVariables("HTTP_USER_AGENT")
response.write("&t1=Your browser version and operating system are:"&ie)
response.write("&t2=The time you logged in is:"&now())
%>---------------------------------num.asp------------------ ----------
//Here is to display the number of logins and record the number of logins into the text.
<%
dim visitors
whichfile=server.mappath("time.txt")
set fs=createobject("Scripting.FileSystemObject")
set thisfile=fs.opentextfile(whichfile)
visitors=(thisfile.readline)
thisfile.close visitors=visitors+1
response.write ("&num="&visitors)
set out=fs.createtextfile(whichfile)
out.writeLine(visitors)
out.close
set fs=nothing
%> -----------http://www.devdao.com/----------time.txt-------------- ------
//Here is the record number of logins 2921 (but you set the initial value yourself)
----------------------------info.swf-----------------
//This is to display the above data inserted into the first pin through flash:
init();
function init() {
settxt();
run();
System.useCodepage = true;
loadVariablesNum("num.asp", "", "POST");
}
function settxt() {
for (i=0; i<4; i++) {
this.createTextField("txt"+i, i, 10, 100+30*i, 90, 0);
this["txt"+i].autoSize = "left";
this["txt"+i].border = true;
}
}
function run() {
lv = new LoadVars();
lv.onLoad = function(ok) {
if (ok) {
for (i=0; i<3; i++) {
_root["txt"+i].text = this["t"+i];
}
delete this.onLoad;
}
};
lv.load("info.asp", "", "POST");
onEnterFrame = function () {
txt3.text = num;//In order to be able to read the number of logins when refreshing, onEnterFrame is used here. //Otherwise the number cannot be refreshed. I tried for a long time.