473,378 Members | 1,330 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,378 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
Nov 22 '05 #1
0 893

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

Similar topics

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...
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...
4
by: Shawn Mesiatowsky | last post by:
I have an html form that accepts a file for uploading, but I wanted to create a program to automate the upload procedure. I beileive you use the Webresponse class, but I was not sure how to use...
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...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
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:
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...

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.