Results 1 to 2 of 2

Thread: [Help] HttpWebRequest problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2011
    Posts
    1

    [Help] HttpWebRequest problem

    Hello

    I am trying to run this code but everytime i got this error

    Code:
    Public Sub Command1_Click()
    Dim fr As System.Net.HttpWebRequest
        Dim targetURI As New Uri("http://whatever.you.want.to.get/file.html")
        fr = DirectCast(HttpWebRequest.Create(targetURI), System.Net.HttpWebRequest)
        If (fr.GetResponse().ContentLength > 0) Then
           Dim str As New System.IO.StreamReader(fr.GetResponse().GetResponseStream())
            Response.Write (str.ReadToEnd())
            str.Close();
        End If
    MsgBox (targetURI)
    End Sub
    Error

    Code:
    user defined type not defined
    Searched on Internet but didnt got the solution. What problem i am getting ?

    Thanks

  2. #2
    Member
    Join Date
    Apr 2009
    Posts
    57

    Re: [Help] HttpWebRequest problem

    First of all, this is the wrong section to be posting this.

    Second of all, what are you exactly trying to do? Read the source of a webpage? If so, you want to do the following...

    Lastly, MSDN is your friend, learn to use it. Hope this helps.

    Reference: http://msdn.microsoft.com/en-us/library/456dfw4f.aspx
    Attached Images Attached Images  

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