-
May 27th, 2009, 11:59 AM
#1
Thread Starter
New Member
Need help on reading text
Howdy all,
I'm a brand new developer, self taught from a book, and I'm having a little trouble with a certain action that I'd like to do. I was hoping to be able to read text off of an html document into Visual Basic for use on an ASP website. I'm specifically using Visual Web Developer 2008, if that matters.
http://www.willowforkgators.com/news...04results.html
Is the link of the site that I'm trying to read the text off of, if that matters as well.
Thanks for any help guys,
BK
-
May 27th, 2009, 03:29 PM
#2
Re: Need help on reading text
Might help to know more specifically what you want to do with the text you read in. But, the FileSystem and File objects may be what you're looking for:
Code:
Dim objFSO, objFile, strReturn
Set ObjFSO = Createobject("Scripting.FileSystemObject")
Set objFile = ObjFSO.GetFile(Server.MapPath("moc2004results.html"))
Set objFile = objFile.OpenAsTextStream()
Do Until objFile.AtEndOfStream
strReturn = strReturn & objFile.ReadLine() & "<br/>"
Loop
response.write strReturn
Of course you can change what you do with the returned object - just an example of reading line by line and outputting it.
FileSystem object reference: http://www.w3schools.com/asp/asp_ref_filesystem.asp
File object reference: http://www.w3schools.com/asp/asp_ref_file.asp
Is that what you're looking for?...
-
May 28th, 2009, 05:08 AM
#3
Re: Need help on reading text
I'm closing this thread. Duplicated in ASP.NET forum http://www.vbforums.com/showthread.php?t=570876
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|