Write to a file A little hit counter.

Here we open a file, reads it content ( just a number ), increment the number and writes it back to the file ( this is a little hit counter )
Dim oFile
Dim nNumber
	
Set oFile = File_OpenExisting( "c:\test.txt", File_OpenForReading  )
If oFile Is Nothing Then
	Response.Write "FATAL ERROR"
Else
	If oFile.AtEndOfStream = True Then
		nNumber = 0
	Else
		nNumber = CInt(oFile.ReadLine())
	End If
	nNumber = nNumber + 1
	oFile.Close
	Set oFile = File_OpenExisting( "c:\test.txt", File_OpenForWriting ) 
	oFile.WriteLine nNumber	
	oFile.Close
End If
Information and tips