473,420 Members | 4,511 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,420 software developers and data experts.

Phantom WebRequest/WebResponse and WebClient

I'm essentially trying to do what a lot of users seem to want when
using the above classes, and that's POST to a webpage.

Well, I'm golden when it comes to POSTing, I've been able to post to
websites using both the webrequest/response and webclient methods.

However, the problem I'm running into with both options is I seem to
"lose" my connection/session.

Let me try to explain a little better. I connect to a website which
has a form with an action that contains a "session id." (for example
form action="example/forum.cfm?CFID=2983DA3") This basically means I
can't hardcode the POST url, I have to load the page and sift through
the HTML for the URL i need to post to.

So essentially, my browsing of this particular webpage relies on a
session id. And if this session expires, any request I make to that
particular session redirects me to the home page and not the intended
page.

Now that I have this session id, I post using any of the two methods
above and things work great. I then repeat this process, posting to
another URL using the same session id.

But! This only works every now and then. It'll always post and give
me the correct page the first two times, however, the phantom behavior
happens on the third try.

Sometimes the post will go through, other times it'll take me to the
home page. And I can't recreate the behavior. It works, then when it
doesn't work I'll wait a little bit later and it'll work again, only
to stop working.

Any ideas on what might be the problem? Could I somehow not be
creating/closing requests/responses correctly, so I have too many
connections to the site?

I thought about this, but it doesn't seem to be the case. I used
netstat to see my connections and each time I ran the program it would
not leave any connections to the website.

Because of this thought, I tried using the WebClient since I don't
have to worry about closing responses, but it still produces the same
strange behavior.

Lost,
-Alfred
Jul 21 '05 #1
0 1247

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

Similar topics

1
by: umeshayk | last post by:
Respected Sir What ever you have explained on WebRequest and WebResponse I came to know very well.I started to implement a project based on this concept.What i did was 1. I used Webrequest to...
1
by: Nurchi BECHED | last post by:
Hello, everyone. I am stuck with the following: There is a webpage which contains a webform, which contains text fields, and submits the data from current page to another one. I need to...
0
by: Gordon | last post by:
I use the following code to get source HTML. The second line seems to work when I get no response from a site. However, I want to stop the request if it's taking more than 20 - 30 seconds. I can't...
6
by: Jensen Bredhal | last post by:
Hello, I need to send command to a web server from a method. I understand this should be possible using the WebClient or WebRequest class. how can this be done? below an example of my...
0
by: omyek | last post by:
I'm essentially trying to do what a lot of users seem to want when using the above classes, and that's POST to a webpage. Well, I'm golden when it comes to POSTing, I've been able to post to...
5
by: james.dixon | last post by:
Hi I have been struggling with what should be a simple thing. I want to crawl the web for specific links, and save any html and files that meet my criteria to my hard drive. I thought that...
1
by: David Satz | last post by:
Hello--I just upgraded to Visual Studio .NET 2005 and suddenly, all my .NET 1.1 applications that accessed Web sites have broken. For example, this code: WebClient wc = new WebClient();...
1
by: Christian Urbanczyk | last post by:
Hello! I have a problem with the Webrequest. I've search everywhere to find an answer but it seems that no one has the the problem before. So i hope somebody can help me here! Following Code:...
2
by: kkb | last post by:
Hello! First, I'm sorry because of my english... I'll try to be understandable! I've got a strange problem using .NET 2003 C# and I haven't figured it out for a long time. I'm implementing an...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.