ITPUB??ì3
报名申请微软有影响力专家
ITPUB论坛 » Web开发 » ASP.NET与AJAX » 求高手帮忙修改一个新闻在线代码!!!!!!

新一届的微软MVP评选已经开始,欢迎各位推荐!

标题: 求高手帮忙修改一个新闻在线代码!!!!!!
离线 etannet
一般会员



精华贴数 0
个人空间 0
技术积分 176 (10931)
社区积分 0 (251410)
注册日期 2005-1-14
论坛徽章:0
      
      

发表于 2007-12-17 10:06 
求高手帮忙修改一个新闻在线代码!!!!!!

由于XPSP2后,系统默认禁止了这种图像显示方式,求修改成文本显示方式



<%@ Language=JavaScript %>
<%
var strCountData="1234567890";
var theTime=new Date();

function GetOnline()
{
if (typeof(Application("GuestOnline"))=="undefined")
Application("GuestOnline")="0";
}

function checkGuest()
{
//check Me
if (typeof(Session("test"))=="undefined")
Session("test")="guest";
var strUserName=String(Session("test"));
var strGuestOnline=String(Application("GuestOnline"));
var GuestArray=strGuestOnline.split("\n");
var i;
var iGuestNum;
if (typeof(Session("GuestNum"))=="undefined")
{
for (i=0;i<GuestArray.length;i++)
{
if (GuestArray=="0") break;
}
Session("GuestNum")=i;
}

iGuestNum=Session("GuestNum")*1;
if (iGuestNum>10000)iGuestNum=10000;

var strFormatTime=theTime.getTime();
strFormatTime="0000000000000000000"+strFormatTime;
strFormatTime=strFormatTime.substr(strFormatTime.length-16,16);

GuestArray[iGuestNum]=strFormatTime+strUserName;

strGuestOnline=GuestArray.join("\n");
Application("GuestOnline")=strGuestOnline;

return 1;
}

function GetNumber()
{
//Count Guests on line
var strFormatTime=theTime.getTime()-5*60*1000;
strFormatTime="0000000000000000000"+strFormatTime;
strFormatTime=strFormatTime.substr(strFormatTime.length-16,16);

var strGuestOnline=String(Application("GuestOnline"));
var GuestArray=strGuestOnline.split("\n");

var iGuestCounter=0;
var i;
for (i=0;i<GuestArray.length;i++)
{
if (GuestArray.substr(0,16)> strFormatTime)
iGuestCounter++;
else if (GuestArray.length>0)
GuestArray="0";
}
strGuestOnline=GuestArray.join("\n");
Application("GuestOnline")=strGuestOnline;
strCountData=iGuestCounter;
return strCountData;
}

function OutPut()
{
var i;
strCountData=""+strCountData;

var strDigits= new Array(
"0","0x3c","0x66","0x66","0x66","0x66","0x66","0x66","0x66","0x66","0x3c", //0
"1","0x30","0x38","0x30","0x30","0x30","0x30","0x30","0x30","0x30","0x30",  //1
"2","0x3c","0x66","0x60","0x60","0x30","0x18","0x0c","0x06","0x06","0x7e",  //2
"3","0x3c","0x66","0x60","0x60","0x38","0x60","0x60","0x60","0x66","0x3c",  //3
"4","0x30","0x30","0x38","0x38","0x34","0x34","0x32","0x7e","0x30","0x78",  //4
"5","0x7e","0x06","0x06","0x06","0x3e","0x60","0x60","0x60","0x66","0x3c",  //5
"6","0x38","0x0c","0x06","0x06","0x3e","0x66","0x66","0x66","0x66","0x3c",  //6
"7","0x7e","0x66","0x60","0x60","0x30","0x30","0x18","0x18","0x0c","0x0c",  //7
"8","0x3c","0x66","0x66","0x66","0x3c","0x66","0x66","0x66","0x66","0x3c",  //8
"9","0x3c","0x66","0x66","0x66","0x66","0x7c","0x60","0x60","0x30","0x1c"); //9

var iCharCount=strCountData.length;
var iCharWidth=8;
var iCharHeight=10;
var theBit;
var theNum;
Response.ContentType ="image/x-xbitmap";
Response.Expires =0;

Response.Write ("#define counter_width "+ iCharWidth*iCharCount+"\r\n");  //图形宽
Response.Write ("#define counter_height "+ iCharHeight+"\r\n");   //图形高
Response.Write ("static unsigned char counter_bits[]={\r\n");

for (iRow=0;iRow<iCharHeight;iRow++)
for (i=0;i<iCharCount;i++)
{
theBit=strCountData.charAt(i);
for (k=0;k<strDigits.length;k+=(iCharHeight+1))
{
if (strDigits[k]==theBit)break;
}
if (k>=strDigits.length)k=0;
theOffset=k+1;

Response.Write (strDigits[theOffset+iRow]);
Response.Write (",");
}

Response.Write ("};\r\n");

}

GetOnline();
checkGuest();
GetNumber();
OutPut();
%>


只看该作者    顶部
离线 mosticy
中级会员


精华贴数 0
个人空间 0
技术积分 2391 (681)
社区积分 2188 (611)
注册日期 2007-10-9
论坛徽章:2
      
      

发表于 2007-12-17 10:29 
代码好多...


__________________
Coming Soon.
只看该作者    顶部
离线 etannet
一般会员



精华贴数 0
个人空间 0
技术积分 176 (10931)
社区积分 0 (251410)
注册日期 2005-1-14
论坛徽章:0
      
      

发表于 2007-12-27 15:34 
?????


只看该作者    顶部
离线 mosticy
中级会员


精华贴数 0
个人空间 0
技术积分 2391 (681)
社区积分 2188 (611)
注册日期 2007-10-9
论坛徽章:2
      
      

发表于 2007-12-28 08:52 
不说问题,不说功能,怎么会有人能改成你希望的样子呢?


__________________
Coming Soon.
只看该作者    顶部
离线 etannet
一般会员



精华贴数 0
个人空间 0
技术积分 176 (10931)
社区积分 0 (251410)
注册日期 2005-1-14
论坛徽章:0
      
      

发表于 2008-5-23 14:58 
只要能在XP中的IE中正常显示统计数就行


只看该作者    顶部
离线 mosticy
中级会员


精华贴数 0
个人空间 0
技术积分 2391 (681)
社区积分 2188 (611)
注册日期 2007-10-9
论坛徽章:2
      
      

发表于 2008-5-24 15:38 
这样的帮,怎么帮?
不是单个问题,是修改代码。。。。。


__________________
Coming Soon.
只看该作者    顶部
 
    

相关内容


CopyRight 1999-2006 itpub.net All Right Reserved.
北京皓辰网域网络信息技术有限公司. 版权所有
E-mail:Webmaster@itpub.net
京ICP证:060528号 联系我们 法律顾问