473,387 Members | 3,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to code the HTTPWebrequest for a second URL

The code below between A> and B> serves to get a webpage from a URL.
My question is:
" What code do I have to add /change after B> in order to start a new web
request, say from URL2, using as many of the already Dim'ed objects?" I
tried many different things but to no avail.
Thank you.
'A>
Dim url, url2, webpage As String

Dim returnStream As Stream

Dim HttpWRqst As HttpWebRequest

Dim HttpWResp As HttpWebResponse

url = "http://moneycentral.msn.com/investor/srs/srsmain.asp?Symbol=IBM"

HttpWRqst = CType(WebRequest.Create(url), HttpWebRequest)

HttpWRqst.Accept = "*/*"

HttpWRqst.KeepAlive = True

HttpWRqst.UserAgent = ".NET Framework Test Client"

HttpWRqst.MaximumAutomaticRedirections = 20

HttpWRqst.MaximumResponseHeadersLength = 9999

HttpWResp = CType(HttpWRqst.GetResponse(), HttpWebResponse)

returnValue = HttpWResp.GetResponseStream()

Dim readstream As New StreamReader(returnStream,False)

WebPage = readstream.ReadToEnd

'B>
url = "http://moneycentral.msn.com/investor/srs/srsmain.asp?Symbol=F"
'C> What to code here reusing as many of the above objects as possible.
Apr 6 '06 #1
0 752

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Nick Jacobsen | last post by:
I am using HTTPWebRequest to connect to a server which requires authentication, then responds with a 302 redirect message, and redirects to DIFFERANT server, which also requires authentication (the...
0
by: v_kravch | last post by:
Hi, I am sending a time-consuming HttpWebRequest asynchronously and would like to get the current progress. Obvious solution, it would seem, to set progress in a session variable and send the...
4
by: R Reyes | last post by:
I am trying to code a file uploader (for forum/email attachments) from the client computer to a remote web server via the PUT method (since POST is not allowed ). However, the upload works ONLY...
6
by: Dan McCollick | last post by:
Hi All, I have a very small screen scrape application, that has a small problem. when I run the app and I have fiddler(an http tool to view what is being sent by the requests/responses,...
1
by: Raj Chudasama | last post by:
i have a need to load image from URL. the image is really small (gif) and i use the following code. but the code is too slow any1 have any alternative way(S)? here is the url...
3
by: Amil | last post by:
Please don't repond to this if you are guessing or just don't know the answer. I'm trying to login to a backend system running Java/Tomcat. I create a HttpWebRequest with the login data and do...
3
by: JansenH | last post by:
We have implemented a 'HTTP Post' client in C# that posts Xml documents to a webserver. This is working fine if the post rate is one post for every 20 seconds. But if the post rate is increased to...
10
by: rlueneberg | last post by:
I am trying to foward the old sessionID using "Session.SessionID" to an HttpWebRequest CookieContainer so that I can capture the requested page session variables but it is not working as it is...
4
by: Natalia | last post by:
Hello, I need to provide the ability to post file and some form elements via our website (asp.net) to the third party website (asp page). On http://aspalliance.com/236#Page4 - I found great...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.