Hej!
Jag har en röstningsfunktion som vid en ja-röst ökar värdet i en textfil som heter "ja.txt" med ett och vice versa.
Nu är det så här:
Med jämna mellanrum blir textfilens värde noll(filen försvinner). Innan jag använde server.mappath och såg till så att textfilen hamnade i min katalog så att jag kunde se den nollställdes(försvann) textfilen när servern startades om.(Någon sa att de då hamnade i någon tempkatalog på servern)
Men nu när filerna ligger i min katalog borde de väl inte försvinna?
Hoppas att någon har en idé om vad som händer.
Tack p.f-hand.
<%
if request.form("knapp")="ja" then
application.lock
application.contents("ja")= application.contents("ja") +1
application.contents("nej")= application.contents("nej") +0
application.unlock
Set F = CreateObject("Scripting.FileSystemObject")
Set g = CreateObject("Scripting.FileSystemObject")
Set T = F.CreateTextFile("c:\www\nyheter\txt\ja.txt")
Set h = g.CreateTextFile("c:\www\nyheter\txt\nej.txt")
T.WriteLine Application.Contents("ja")
h.WriteLine Application.Contents("nej")
T.Close
h.close
Set A = CreateObject("Scripting.FileSystemObject")
Set c = CreateObject("Scripting.FileSystemObject")
Set B = A.OpenTextFile("c:\www\nyheter\txt\ja.txt", 1)
Set d = c.OpenTextFile("c:\www\nyheter\txt\nej.txt", 1)
Pos = B.ReadLine
Neg = d.ReadLine
B.Close
d.close %>
251 ms totalt · 4 externa anrop · v20260731065814-full.d34c6d5a