Har denna kod.Men vill att bara 500 rader skall sparas till en xtxfil. Sen ska de gamlaste raderna skrivas över.
<!--#Include file="top.asp"-->
<meta http-equiv="refresh" content="10">
<body>
<%If Not fso.FileExists(Server.MapPath("chat.txt")) Then
Set fil = fso.CreateTextFile(Server.Mappath("chat.txt"), true)
fil.WriteLine(Day(Now) & "/" & Month(Now) & "-" & FormatDateTime(Now,4) & " | <i><b>" & Session("user") & "</b> har loggat in</i>")
End If
set fil = fso.OpenTextFile(Server.Mappath("chat.txt"), 1 )
arrFsoLines = Split(fil.ReadAll, vbcrlf)
For i = ubound(arrFsoLines) To 0 step -1%>
<%=arrFsoLines(i)%><br>
<%Next
fil.Close
If Request.QueryString("do") = "skapa" Then
Info = Day(Now) & "/" & Month(Now) & "-" & FormatDateTime(Now,4) & " | <b>" & Session("user") & "</b> - " & Replace(Request.Form("info"), vbcrlf, "")
Set fso = CreateObject("Scripting.FileSystemObject")
Set fil = fso.OpenTextFile(Server.Mappath("chat.txt"), 8 )
fil.WriteLine(Info)
fil.close
Response.Redirect "mess.asp"
End If%>
</body>
</html>
