how to read a text file and store the data inside e text file as a varible?<BR><BR>I want to create a counter that stores how many time a person refers a friend. the data in the counter will be added on every vist.<BR><BR>pleas advice. <BR><BR>here are my codes. pls help me look where i have gone wrong.. thanks<BR><BR>FYI : totFrdsRefered is a variable storing number of emails e user enters<BR><BR>&#060;%<BR><BR>Dim Stuff, myFSO, sf, WriteStuff, theTextFile, newStuff<BR><BR>Set myFSO = CreateObject("Scripting.FileSystemObject")<BR><BR> <BR>If (myFSO.FileExists("C:InetpubwwwrootKris
eadme.txt"))=false Then<BR> Set WriteStuff = myFSO.OpenTextFile("C:InetpubwwwrootKris
eadme.txt", 8, True)<BR> WriteStuff.WriteLine(totFrdsRefered)<BR> Stuff = totFrdsRefered<BR> SET WriteStuff = NOTHING<BR> SET myFSO = NOTHING<BR> &#039;Response.Redirect("refer_friend_tq.asp?tmpMs g="&tmpMailMsg&"&tmpfemail_1="&tmpfemail_1)<BR>Els e<BR> if (myFSO.FileExists("C:InetpubwwwrootKris
eadme.txt"))=true Then<BR> Set theTextFile= myFSO.OpenTextFile("C:InetpubwwwrootKris
eadme.txt",1)<BR> sf = theTextFile.ReadLine<BR> Response.Write("sf "&sf)<BR>&#039; Response.End()<BR> theTextFile.Close<BR> newStuff = sf + totFrdsRefered<BR> Set WriteStuff = myFSO.OpenTextFile("C:InetpubwwwrootKris
eadme.txt", 2, True)<BR> WriteStuff.WriteLine(newStuff)<BR> WriteStuff.Close<BR> SET WriteStuff = NOTHING<BR> SET myFSO = NOTHING<BR> End If<BR> <BR> &#039;Response.Redirect("refer_friend_tq.asp?tmpMs g="&tmpMailMsg&"&tmpfemail_1="&tmpfemail_1)<BR> end if<BR>%&#062;<BR>