Results 1 to 3 of 3

Thread: Need help on reading text

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2009
    Posts
    4

    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

  2. #2
    Frenzied Member
    Join Date
    Apr 2009
    Location
    CA, USA
    Posts
    1,516

    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?...

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,173

    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
  •  



Click Here to Expand Forum to Full Width