|
-
Jun 6th, 2010, 10:58 AM
#1
Thread Starter
Lively Member
httpwebrequest
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/")
-
Jun 6th, 2010, 12:36 PM
#2
Lively Member
Re: httpwebrequest
Have you added
at the top of your code, before the Public Class Form statement? I think this is needed for creating web requests.
-
Jun 6th, 2010, 02:55 PM
#3
Thread Starter
Lively Member
Re: httpwebrequest
 Originally Posted by wearmc
Have you added
at the top of your code, before the Public Class Form statement? I think this is needed for creating web requests.
HI Colin,
Imports System.Net was already there, however I found the error.
When I changed it to
vb Code:
Dim Request As HttpWebRequest = Net.WebRequest.Create(url)
All was ok.
-
Jun 6th, 2010, 03:01 PM
#4
Lively Member
Re: httpwebrequest
Glad to hear you found a solution. Good Work.
-
Jun 6th, 2010, 07:58 PM
#5
Re: httpwebrequest
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.
-
Jun 7th, 2010, 02:04 AM
#6
Thread Starter
Lively Member
Re: httpwebrequest
 Originally Posted by jmcilhinney
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.
Aaah!
Thats what is was, my project is called WebRequest.
Thanks jmcilhinney
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
|