spetsnaz
07-12-2004, 11:14 AM
<%
''''''''''''''''''''''''''''''''''''''''''''''''''declare crap
dim fs
dim f
dim lines
dim x
'''''''''''''''''''''''''''''''''''''''''''''''''' set up all variables
input = request.QueryString("textfield")
set fs = Server.CreateObject("Scripting.FileSystemObject")
set f = fs.OpenTextFile(Server.MapPath("text.txt"),1,true,-2)
'''''''''''''''''''''''''''''''''''''''''''''''''' count the number of files
lines = 0
do while f.AtEndOfStream = false
lines = lines + 1
loop
'''''''''''''''''''''''''''''''''''''''''''''''''' check for username
for x=1 to lines
if input = f.ReadLine then
a = true
exit for
else
a = false
end if
next
'''''''''''''''''''''''''''''''''''''''''''''''''' infor user of his/her registration statues
if a = true then
Response.Write("you are registered")
else
Response.Write("you are not registered")
end if
'''''''''''''''''''''''''''''''''''''''''''''''''' prevent memory leaks
f.close
set f = nothing
set fs = nothing
%>
in the section "check for username" am i going to the next line after reading the current line? coz at the min iam just getting an infinite loop as for some reason the script never exists that for loop. if it doesnt goto the next line how does make i go to thenext line? also is it legal to use exit for like i have in the "check for username".
''''''''''''''''''''''''''''''''''''''''''''''''''declare crap
dim fs
dim f
dim lines
dim x
'''''''''''''''''''''''''''''''''''''''''''''''''' set up all variables
input = request.QueryString("textfield")
set fs = Server.CreateObject("Scripting.FileSystemObject")
set f = fs.OpenTextFile(Server.MapPath("text.txt"),1,true,-2)
'''''''''''''''''''''''''''''''''''''''''''''''''' count the number of files
lines = 0
do while f.AtEndOfStream = false
lines = lines + 1
loop
'''''''''''''''''''''''''''''''''''''''''''''''''' check for username
for x=1 to lines
if input = f.ReadLine then
a = true
exit for
else
a = false
end if
next
'''''''''''''''''''''''''''''''''''''''''''''''''' infor user of his/her registration statues
if a = true then
Response.Write("you are registered")
else
Response.Write("you are not registered")
end if
'''''''''''''''''''''''''''''''''''''''''''''''''' prevent memory leaks
f.close
set f = nothing
set fs = nothing
%>
in the section "check for username" am i going to the next line after reading the current line? coz at the min iam just getting an infinite loop as for some reason the script never exists that for loop. if it doesnt goto the next line how does make i go to thenext line? also is it legal to use exit for like i have in the "check for username".