/ Forside/ Teknologi / Udvikling / ASP / Spørgsmål
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
ASP
#NavnPoint
smorch 9259
Harlekin 1866
molokyle 1040
Steffanst.. 758
gandalf 657
smilly 564
gibson 560
cumano 530
MouseKeep.. 480
10  Random 410
counter
Fra : hklarsen
Vist : 494 gange
34 point
Dato : 20-10-01 20:10

Hej alle

Er nogen som kan fortælle mig hvad der er i vejen med min asp tæller, den stå konstant på 32.

Med venlig Hilsen Hans Larsen

<%
' Declare variables
Dim ObjCounterFile, ReadCounterFile, WriteCounterFile
Dim CounterFile
Dim CounterHits
Dim FixedDigitCount
Dim DigitCount
Dim DigitCountLength
Dim DigitZerosToAdd
Dim DigitZeroCount
Dim ShowDigits
Dim DigitPath
   
' (FixedDigitCount) will add zeros to the front of your count
' if the count is less then the (FixedDigitCount)
' just like "frontpage" counters let you do
   
FixedDigitCount = 5
DigitPath = "digits/green_on_black"
   
On Error Resume Next
   
Set ObjCounterFile = Server.CreateObject("Scripting.FileSystemObject")
   
   CounterFile = Server.MapPath ("counter.txt")
   
   Set ReadCounterFile= ObjCounterFile.OpenTextFile (CounterFile, 1, True)
   
      If Not ReadCounterFile.AtEndOfStream Then
         CounterHits = Trim(ReadCounterFile.ReadLine)
         If CounterHits = "" Then CounterHits = 0
      Else
         CounterHits = 0
      End If
   
   ReadCounterFile.Close
   Set ReadCounterFile = Nothing
   
   CounterHits = CounterHits + 1
   
   Set WriteCounterFile= ObjCounterFile.CreateTextFile (CounterFile, True)
      WriteCounterFile.WriteLine(CounterHits)
   WriteCounterFile.Close
   Set WriteCounterFile = Nothing
   
Set ObjCounterFile = Nothing
   
DigitCountLength = Len(CounterHits)
   
If DigitCountLength < FixedDigitCount Then
   DigitZerosToAdd= FixedDigitCount - DigitCountLength
   DigitZeroCount = 1
   For DigitZeroCount = DigitZeroCount to DigitZerosToAdd
      ShowDigits = ShowDigits & "<img src=""" & DigitPath & "/0.gif"" Alt =""" & CounterHits & " Visitors"" >"
   Next
End If
   
DigitCount = 1
For DigitCount = DigitCount to DigitCountLength
   ShowDigits = ShowDigits & "<img src=""" & DigitPath & "/" & Mid(CounterHits,DigitCount,1) & ".gif"" Alt =""" & CounterHits & " Visitors"">"
Next
%>

<% =ShowDigits %>





 
 
Kommentar
Fra : deurell


Dato : 21-10-01 10:49

jeg kan ikke helt gennemskue scriptet me siger du at den starter på 32 eller stopper den når den når der til?

Accepteret svar
Fra : Nyhedsbruger

Modtaget 34 point
Dato : 21-10-01 18:17

hklarsen wrote:
>
> Er nogen som kan fortælle mig hvad der er i vejen med min asp
> tæller, den stå konstant på 32.

Jeg gætter på at den bruger, som webserveren benytter ikke har skrive
adgang i det katalog, hvor tekstfilen ligger (brugeren hedder normalt
iusr_<maskinnavn>).

--
Anders

Godkendelse af svar
Fra : hklarsen


Dato : 22-10-01 19:40

Tak for svaret Anders Holbøll.
                        

Kommentar
Fra : Nyhedsbruger


Dato : 25-10-01 17:00

du kan hente en her gratis http://www.wservice.dk/wservice-dk/
"hklarsen" <hklarsen.news@kandu.dk> skrev i en meddelelse
news:z1jA7.5571$5v1.421042@news010.worldonline.dk...
> Hej alle
>
> Er nogen som kan fortælle mig hvad der er i vejen med min asp tæller,
> den stå konstant på 32.
>
> Med venlig Hilsen Hans Larsen
>
> <%
> ' Declare variables
> Dim ObjCounterFile, ReadCounterFile, WriteCounterFile
> Dim CounterFile
> Dim CounterHits
> Dim FixedDigitCount
> Dim DigitCount
> Dim DigitCountLength
> Dim DigitZerosToAdd
> Dim DigitZeroCount
> Dim ShowDigits
> Dim DigitPath
>
> ' (FixedDigitCount) will add zeros to the front of your count
> ' if the count is less then the (FixedDigitCount)
> ' just like "frontpage" counters let you do
>
> FixedDigitCount = 5
> DigitPath = "digits/green_on_black"
>
> On Error Resume Next
>
> Set ObjCounterFile = Server.CreateObject("Scripting.FileSystemObject")
>
> CounterFile = Server.MapPath ("counter.txt")
>
> Set ReadCounterFile= ObjCounterFile.OpenTextFile (CounterFile, 1, True)
>
> If Not ReadCounterFile.AtEndOfStream Then
> CounterHits = Trim(ReadCounterFile.ReadLine)
> If CounterHits = "" Then CounterHits = 0
> Else
> CounterHits = 0
> End If
>
> ReadCounterFile.Close
> Set ReadCounterFile = Nothing
>
> CounterHits = CounterHits + 1
>
> Set WriteCounterFile= ObjCounterFile.CreateTextFile (CounterFile, True)
> WriteCounterFile.WriteLine(CounterHits)
> WriteCounterFile.Close
> Set WriteCounterFile = Nothing
>
> Set ObjCounterFile = Nothing
>
> DigitCountLength = Len(CounterHits)
>
> If DigitCountLength < FixedDigitCount Then
> DigitZerosToAdd= FixedDigitCount - DigitCountLength
> DigitZeroCount = 1
> For DigitZeroCount = DigitZeroCount to DigitZerosToAdd
> ShowDigits = ShowDigits & "<img src=""" & DigitPath & "/0.gif"" Alt
> =""" & CounterHits & " Visitors"" >"
> Next
> End If
>
> DigitCount = 1
> For DigitCount = DigitCount to DigitCountLength
> ShowDigits = ShowDigits & "<img src=""" & DigitPath & "/" &
> Mid(CounterHits,DigitCount,1) & ".gif"" Alt =""" & CounterHits & "
> Visitors"">"
> Next
> %>
>
> <% =ShowDigits %>
>
>
>
>
>
> --
> Leveret af:
> http://www.kandu.dk/
> "Vejen til en hurtig løsning"
>



Du har følgende muligheder
Eftersom du ikke er logget ind i systemet, kan du ikke skrive et indlæg til dette spørgsmål.

Hvis du ikke allerede er registreret, kan du gratis blive medlem, ved at trykke på "Bliv medlem" ude i menuen.
Søg
Reklame
Statistik
Spørgsmål : 177429
Tips : 31962
Nyheder : 719565
Indlæg : 6407950
Brugere : 218878

Månedens bedste
Årets bedste
Sidste års bedste