Contador gráfico en ASP

1. En primer lugar, hay que crear las imágenes que van a sustituir a los números del contador. Estas imágenes tendrán el nombre 0.gif, 1.gif, 2.gif, ... , 9.gif. Se pueden guardar en una carpeta llamada "contador". 2. En segundo lugar, crear un fichero de texto (p.e.:"contador.txt") e introducir en él el número inicial a partir del cual hay que empezar a contar.
				<p>'-------------CODIGO PARA EL ARCHIVO GLOBAL.ASA------------ Sub Application_OnStart set fso=server.CreateObject("Scripting.FileSystemObject") set fichero=fso.OpenTextFile(Server.MapPath("contador.txt")) Application("visitas")=fichero.ReadLine fichero.Close End Sub Sub Session_OnStart Application.Lock Application("visitas")=cint(Application("visitas"))+1 Application.Unlock End Sub Sub Application_OnEnd 'Creamos un nuevo fichero con la misma ruta y nombre set fichero2=fso.CreateTextFile(server.MapPath("contador.txt"),true) 'Escribimos en el nuevo fichero la cifra de la última visita fichero2.Write(cstr(Application("visitas")) fichero2.Close set fso=nothing set fichero=nothing set fichero2=nothing End Sub '-------------CODIGO PARA LA PAGINA DONDE TIENE QUE APARECER EL CONTADOR------------ <%for i=1 to len(Application("visitas")) num=mid(Application("visitas"),i,1) Response.Write "<img src="images/contador/" alt="" />" next%></p>
<p><span style="border-radius: 2px; text-indent: 20px; width: auto; padding: 0px 4px 0px 0px; text-align: center; font: bold 11px/20px 'Helvetica Neue',Helvetica,sans-serif; color: #ffffff; background: #bd081c no-repeat scroll 3px 50% / 14px 14px; position: absolute; opacity: 1; z-index: 8675309; display: none; cursor: pointer;">Guardar</span></p>
<p><span style="border-radius: 2px; text-indent: 20px; width: auto; padding: 0px 4px 0px 0px; text-align: center; font: bold 11px/20px 'Helvetica Neue',Helvetica,sans-serif; color: #ffffff; background: #bd081c no-repeat scroll 3px 50% / 14px 14px; position: absolute; opacity: 1; z-index: 8675309; display: none; cursor: pointer;">Guardar</span></p>
<p><span style="border-radius: 2px; text-indent: 20px; width: auto; padding: 0px 4px 0px 0px; text-align: center; font: bold 11px/20px 'Helvetica Neue',Helvetica,sans-serif; color: #ffffff; background: #bd081c no-repeat scroll 3px 50% / 14px 14px; position: absolute; opacity: 1; z-index: 8675309; display: none; cursor: pointer;">Guardar</span></p>
<p><span style="border-radius: 2px; text-indent: 20px; width: auto; padding: 0px 4px 0px 0px; text-align: center; font: bold 11px/20px 'Helvetica Neue',Helvetica,sans-serif; color: #ffffff; background: #bd081c no-repeat scroll 3px 50% / 14px 14px; position: absolute; opacity: 1; z-index: 8675309; display: none; cursor: pointer;">Guardar</span></p>
Descargar adjuntos
COMPARTE ESTE TUTORIAL

COMPARTIR EN FACEBOOK
COMPARTIR EN TWITTER
COMPARTIR EN LINKEDIN
COMPARTIR EN WHATSAPP
SIGUIENTE TUTORIAL