SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Jan 2012
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Read remote page line by line (asp Classic)

    Hi there

    Is there a way to read a remote page line by line?

    regards

    Jeremy

  2. #2
    SitePoint Enthusiast
    Join Date
    Jan 2012
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can read a remote page using :

    http://classicasp.aspfaq.com/general...-web-page.html

    to read it line by line, you put the response to an array and process line by line.

  3. #3
    SitePoint Member
    Join Date
    Jan 2012
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it doesnt show how to read line by line

  4. #4
    SitePoint Enthusiast
    Join Date
    Jan 2012
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can you show some code, how far have you got to ?

  5. #5
    SitePoint Enthusiast
    Join Date
    Jan 2012
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can try this:

    Code:
    <%
        Dim url,strArr,xmlhttp,lineno
        
        url = "http://127.0.0.1/lines.txt" 
        
        set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") 
        xmlhttp.open "GET", url, false 
        xmlhttp.send "" 
        'Response.write xmlhttp.responseText 
        
        strArr = split(xmlhttp.responseText,vbcrlf)
        set xmlhttp = nothing 
        
        for lineno=0 to ubound(strArr)
            Response.Write "Line"&lineno+1&" :"&strArr(lineno)&"<br>"
        next
        
        
        
    
     %>

  6. #6
    SitePoint Member
    Join Date
    Jan 2012
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It worked thank you


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •