473,808 Members | 2,761 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session Persistance Using System.Net.Http WebRequest

I'm having trouble porting something from VB 6.0 with
MSXML 4.0 to C# and the .Net framework.

Using MSXML 4.0, I use the HTTPRequest object to get the
following page and obtain a list of parameters from the
search drop-downs (in this case, city names):

http://www.edpa.org/bsc/viewcountyfrommap.asp?
action=search

Using this list, I can retrieve data for each city using
the folowing URL and postdata:

(URL)
http://www.edpa.org/bsc/viewcountyfrommap.asp?

(PostData)
city_code=005&c ounty_code=&cnt y_msa_code=&x=9 &y=14

I've figured out how to do a "get" for the initial search
page and extract the city information using a regular
expression. The problem I have is "Posting" data to get
the detail page.

Using System.Net.Http WebRequest, I can send the post data
using a streamwriter. Unfortunately, the website can
somehow determine that I'm attempting to directly request
a detail page without first going to the intitial search
page. It returns a page stating that I'm not logged in.
I looked through the response object thinking that
cookies were used by the website to figure this out. I
was wrong and can't figure out what I need to do so the
website will return a detail page.

How do I retrieve the detail pages for this website by
sending the postdata? It works with MSXML 4.0 because I
can use the same HttpRequest object to hit the search
page and then hit the detail page.

System.Net.Http WebRequest is different in that once a
request object is used, I can't modify it for sending
postdata. I also tried setting the Referer but haven't
had any luck.

Any advice would be very much appreciated.

Jul 19 '05 #1
0 2881

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

Similar topics

3
3652
by: Jeff | last post by:
We're running a fairly busy and complex e-commerce website. It's an online retailer. We utilize MySQL for most of our site-based dynamic data, and then we use Oracle to access inventory and place orders. We have two seperate machines for database and web application (reasonably powerful dual xeon 3ghz machines, 6gb ram each). We're running Apache 1.3.28 with PHP 4.3.3, mod_ssl 2.8.15 and OpenSSL 0.9.6b. We are running MySQL 4.0.16 as our...
1
5809
by: Dax Westerman | last post by:
I have a site that I'm trying to migrate to ASP.NET from ASP, and the foremost stumbling block I'm hitting is session state between the ASP and ASP.NET applications. In order to access this information, I'm doing a HttpWebRequest from the ASP.NET side into an .asp page, passing the session name on the get in order to request it from the ASP side and write it back to the response stream, giving ASP.NET access to it. Of course I change...
0
350
by: Todd | last post by:
I'm having trouble porting something from VB 6.0 with MSXML 4.0 to C# and the .Net framework. Using MSXML 4.0, I use the HTTPRequest object to get the following page and obtain a list of parameters from the search drop-downs (in this case, city names): http://www.edpa.org/bsc/viewcountyfrommap.asp? action=search
0
9206
by: Peter Qian | last post by:
Hi, I'm working on a windows form based program that can log into a web service (Apache based, https is used for auth). I was able to post the login data and obtain a sessionID. However I'm not sure how to maintain this id over multiple requests. Here are my code: Globle Varibles private static int timeOut = 20000; private CookieContainer cookieContainer; /* other cookies */
3
7380
by: Karsten Grombach | last post by:
Hi, I'm trying the following: - Imitate a Logon using a Post with HttpWebRequest on remote Webserver (asp 3.0 page using https) - On success redirect to the page (encapsuled in an iframe) supplied by the remote Webserver I can successfuly logon but when I redirect to the supplied url, the webserver does not know me anymore an redirects me back to login page.. I
0
1175
by: Dax Westerman | last post by:
I have a site that I'm trying to migrate to ASP.NET from ASP, and the foremost stumbling block I'm hitting is session state between the ASP and ASP.NET applications. In order to access this information, I'm doing a HttpWebRequest from the ASP.NET side into an .asp page, passing the session name on the get in order to request it from the ASP side and write it back to the response stream, giving ASP.NET access to it. Of course I change...
0
1314
by: paul | last post by:
I must (as a client application) connect via HTTP, authenticate using DIGEST authentication, and then make subsequent HTTP requests. The Problem: If I use System.Net.WebClient or System.Net.HttpWebRequest, my initial HTTP request is met with a: HTTP/1.1 401 Unauthorized xxx Set-Cookie: ARPT=ZYQ123; path=/
4
404
by: Chris Newby | last post by:
My project currently requires that I integrate an ASP.NET application with an ASP application. One of the issues I'm having is that I have some very long strings being created in an ASP.NET application that need to somehow appear in a classic ASP session. The strings are too long for cookies or URLs and I'd like to avoid using a database or someother temporary server storage. So far what I've come up with is a .NET class that "spoofs" a...
3
8840
by: ThatsIT.net.au | last post by:
I am making a console app that requests pages from our site one after another. Each request starts a new session, What I want to do is make all requests in the same session. How can I do this. I was hoping to be able to get the session back from first request and then set them on each further request. Any ideas?
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9600
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10376
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10114
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5548
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4331
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3860
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.