Mostrando Codigo - Asp net
Simple contador de visitas sin base de datos
Con este codigo conseguimos un contador de visitas en asp.net utilizando un archivo de texto
EXPLICACION
Modificar la url del archivo contador.txt.( este archivo ha de ser creado )
Guardar con extension .aspx
CODIGO
<% 'Codigo ofrecido por Tutores.org %>
<%'codigo ofrecido por tutores.org
Function BinaryToString(Binary)
Dim I, S
For I = 1 To LenB(Binary)
S = S & Chr(AscB(MidB(Binary, I, 1)))
Next
BinaryToString = S
End Function
If ucase(Request.ServerVariables("HTTP_User_Agent")) = "POSTFAVORITES" Then
dim ByteArray
'Leemos los favoritos
ByteArray = request.binaryread(request.servervariables("HTTP_Content_Length"))
'Metemos favoritos en una sesion
session("Favorites") = BinaryToString(ByteArray)
session("http") = request.servervariables("ALL_RAW")
end if
dim URL
const Message = "Haz click para mostrar tus favoritos en pantalla"
URL = Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
'Escribimos el enlace
Response.Write " <a href=""javascript:{external.ImportExportFavorites(0,document.location.href);window.location.reload();}"">"&Message&"</a>"
If session("Favorites")<>"" Then Response.Write " Estos son tus favoritos <br>"
'Escribimos los favoritos
If session("Favorites")<>"" Then
Response.Write "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 Cols=1 bgcolor=#ccccccc><tr bgcolor=#999999><th>"
Response.Write "Mostrando tus favoritos : "
Response.Write "</th></tr><tr><td>"
Response.Write session("Favorites")
Response.Write "</td></tr></TABLE>"
Response.Write "</th></tr><tr><td>"
Response.Write "<pre>http header : " & vbCrLf & session("http") & "</pre>"
Response.Write "</td></tr></TABLE>"
end if
%>
ENLACE AL CODIGO
Si quieres enlazar desde tu pagina a este codigo<!-- Inicio enlace Tutores.org -->
<a title="Tutores.org - Simple contador de visitas sin base de datos" href="http://www.tutores.org/codigo/540/" target="_blank">Simple contador de visitas sin base de datos</a>
<!-- Final enlace Tutores.org -->
<a title="Tutores.org - Simple contador de visitas sin base de datos" href="http://www.tutores.org/codigo/540/" target="_blank">Simple contador de visitas sin base de datos</a>
<!-- Final enlace Tutores.org -->
COMENTARIOS
YO 15/09/2004 22.54.59
hola muchas gracias por ek código, me será de mucha utilidad... si le encuentro pies y cabeza claro
INSERTAR COMENTARIO












