Thursday, October 05, 2006

reading the text file

I haven't updated in a very long time, why? Lets just say I had a very long holiday...

Well anyway, I left off having managed to get a URL and stick the code in a text file, next I needed to be able to look at the text file so I could begin searching it for URLs and emails. It took me ages to find out but http://www.garybeene.com/vb/tut-file.htm was a very helpful site. Here's the code to open a text file, read each line into the temp string and then stick each line into the alltext string - finally it displays it into a textbox.

Open "N:\vbspider\vbspider\searchresult.txt" For Input As #1
While Not EOF(1)Line Input #1,
temp$alltext$ = alltext$ & temp$ & vbCrLf
WendText1.Text = alltext$
Close #1

0 Comments:

Post a Comment

<< Home