网络精英计数器源程序

2016-01-29 17:18 4 1 收藏

网络精英计数器源程序,网络精英计数器源程序

【 tulaoshi.com - ASP 】

  使用了imagelib组件!
     <%
     site_id=Request.QueryString("site_id")
     if isempty(site_id) then
     Response.End
     end if
     
     Set Sistema = CreateObject("Scripting.FileSystemObject")
     set ILIB = server.createobject("Overpower.ImageLib")
     path=server.MapPath("../保存计数文件的路径/")
     CounterFile=path & "count_"& site_id &".txt"
     contagem = 0
     if Sistema.FileExists(counterfile) then
     Set arquivo = Sistema.GetFile(counterfile)
     Set texto = arquivo.OpenAsTextStream(1, -2)
     contagem = texto.readline
     texto.close
     end if
     contagem = contagem + 1
     
     Set texto = sistema.CreateTextFile(counterfile, true, false)
     texto.writeline contagem
     texto.close
     
     texto = contagem
     if contagem 1 then texto = texto
     textolen=len(texto)
     for i=1 to 8-textolen
     texto="0" & texto
     next
     
     ILIB.FontColor = "#00ff00" '字体色
     ILIB.BrushColor = "#000000" '背景色
     'ILIB.FontFace = "Verdana"
     'ILIB.FontFace = "Checkers"
     ILIB.FontSize = 8
     ILIB.FontBold = false
     ILIB.width = ILIB.GetTextwidth(texto)+5
     ILIB.height = ILIB.GetTextHeight(texto)+5
     ILIB.PenColor = "#307C3B" '边框色
     ILIB.Box 1,1,ILIB.WIDTH,ILIB.HEIGHT
     ILIB.Textout texto,3,3
     
     ILIB.Textout "",ILIB.width/2 - tamanho/2,10
     
     ILIB.PictureBinaryWrite 2, 0, ""
     
     Set Sistema =nothing
     set ILIB =nothing
     Set arquivo = nothing
     Set texto = nothing
     %
     本计数器使用了ImageLib组件,在使用程序前需要先注册该组件;
     假如说你将文件保存为count.asp,然后在与count.asp,然后通过下面代码引用本计数器:
     <img src="http://img.jcwcn.com/attachment/portal"

来源:http://www.tulaoshi.com/n/20160129/1500917.html

延伸阅读
标签: ASP
<% dim fso,f,no,I '定义变量绝对是个好习惯 Set fso = CreateObject("Scripting.FileSystemObject") '建立对象的实例 Set f = fso.OpenTextFile(Server.MapPath("count.no"), 1, True) '建立文本文件,打开为只读. if f.AtEndOfStream then '判断这个文件是否不存在 no=1 else no=f.ReadLine no=no+1 end if f.Close set f=fso.O...
标签: PHP
       <?php         $counterFile = "balong.txt";//存储数值的文件名几路径      function displayCounter($counterFile) {    $fp = fopen($counterFile,"rw");    $num = fgets($fp,5);    $num +...
标签: PHP
  最近嘉新的计数器改成文本的了,不过正好.. //count.php -js 应用版 <? $a=file("http://www.jx.zj.cninfo.net/cgi-bin/count.cgi?df=wfnic.dat"); print "document.write('<b$a[0]</b');"; ? //php 直接版 <? $a=file("http://www.jx.zj.cninfo.net/cgi-bin/count.cgi?df=wfnic.dat"...
标签: ASP
  以下介绍用数据库实现简单计数器 '下面存为count.asp <% Set conn=Server.CreateObject("ADODB.Connection") conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq="& Server.MapPath("count.mdb") % <%on error resume next% <%sql="update count set hit=hit+1%<%conn.Execute(sql)% <%sql = "sele...
标签: PHP
  <?   //require (’common.inc’);   $arr_request=array();   if (count($HTTP_GET_VARS))       {       while (list($key,$value)=each($HTTP_GET_VARS))       {      &nbs...

经验教程

433

收藏

60
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部