Hi,
I am trying to use httpwebrequest but I keep getting a message that says "Create is not a member of webrequest" every time I try and use the msn example code.
vb Code:
Dim myReq As HttpWebRequest = WebRequest.Create("http://www.contoso.com/")
Printable View
Hi,
I am trying to use httpwebrequest but I keep getting a message that says "Create is not a member of webrequest" every time I try and use the msn example code.
vb Code:
Dim myReq As HttpWebRequest = WebRequest.Create("http://www.contoso.com/")
Have you added
at the top of your code, before the Public Class Form statement? I think this is needed for creating web requests.Code:Imports System.Net
Glad to hear you found a solution. Good Work.
It sounds like you had a name clash. I'm guessing that either your project or the class that that code is in was called WebRequest, so the code interpreted your reference as that. By qualifying the name you changed the meaning of the code and it referred to the correct type.