Problem reading URL

Hey!
I've got a strange problem. I'll try to explain:
There is a webpage (url1) where there is a linkbutton to anotherurl(url2). If in internet explorer i navigate first to url1 and then to url2 there is no problem but if I open new explorer and want to go staight to url2 then i get some message from the site that data missing.
I guess there is some session variables that the site holds and when i try to come to url2 without visiting url1 first it doesn't work.

Now to the question, how can i read the data from url2 fromC# code?
I tried making the two requests one after another but it didn't help:

req = (HttpWebRequest)WebRequest.Create(url1);
res = (HttpWebResponse)req.GetResponse();
req = (HttpWebRequest)WebRequest.Create(url2);
res = (HttpWebResponse)req.GetResponse();
sr = new StreamReader(res.GetResponseStream());
line = sr.ReadToEnd();

It is very important to me to make that work. I'll appriciate any help. If after my description something not clear feel free to ask.
Thanx in advance.
Max.

[1682 byte] By [tombraider] at [2008-1-4]
# 1

hi,

from the code that you posted i can see that,

you dont navigate to url2 through url1 !!! ........ but you still go to url2 directly sooo the probem surly will still exist.

If the webserver doesn't enable you to go to the url2 directly then i think it will be a hard mission to do what you need Smile

bolashokry at 2007-9-25 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...

.NET Development

Site Classified