473,698 Members | 2,888 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get url returned from request redirect

Right now I am posting data to a webpage by doing the following

webRequest =
CType(System.Ne t.WebRequest.Cr eate("http://www.domain.com/login.asp"),
Net.HttpWebRequ est)

webRequest.Meth od = "POST"

webRequest.Cook ieContainer = Cookies

postData = "Submit=Go&id=a sdDSDFsdf&pid=3 4g4"

data = System.Text.Enc oding.UTF8.GetB ytes(postData)

webRequest.Cont entType = "applicatio n/x-www-form-urlencoded"

webRequest.Cont entLength = data.Length

Dim RequestStream As IO.Stream = webRequest.GetR equestStream

RequestStream.W rite(data, 0, data.Length)

RequestStream.C lose()

webResponse = CType(webReques t.GetResponse() , Net.HttpWebResp onse)

Now when I send that, the response is a new webpage (it redirected to it
after it authenticated my login account) I dont want to get the entire page
retured, I just want the URL that the new page is on, is there any way to do
this with out downloading the entire response (its large and a waste of
bandwidth since all I need is just the URL)... the URL is in the format of
http://www.domain.com/nextpage.asp?G...5G45G45WGREGDG

Any help would be nice, thanks!
Mar 10 '07 #1
2 1790
On Mar 10, 3:28 pm, "Smokey Grindel" <nos...@nospam. comwrote:
Right now I am posting data to a webpage by doing the following

webRequest =
CType(System.Ne t.WebRequest.Cr eate("http://www.domain.com/login.asp"),
Net.HttpWebRequ est)

webRequest.Meth od = "POST"

webRequest.Cook ieContainer = Cookies

postData = "Submit=Go&id=a sdDSDFsdf&pid=3 4g4"

data = System.Text.Enc oding.UTF8.GetB ytes(postData)

webRequest.Cont entType = "applicatio n/x-www-form-urlencoded"

webRequest.Cont entLength = data.Length

Dim RequestStream As IO.Stream = webRequest.GetR equestStream

RequestStream.W rite(data, 0, data.Length)

RequestStream.C lose()

webResponse = CType(webReques t.GetResponse() , Net.HttpWebResp onse)

Now when I send that, the response is a new webpage (it redirected to it
after it authenticated my login account) I dont want to get the entire page
retured, I just want the URL that the new page is on, is there any way to do
this with out downloading the entire response (its large and a waste of
bandwidth since all I need is just the URL)... the URL is in the format ofhttp://www.domain.com/nextpage.asp?GU ID=45T45G45G45G 45G45WGREGDG

Any help would be nice, thanks!
You have to get the entire response to find the url, I think. Or you
have to know your GUID

Mar 10 '07 #2
but even with the entire response how do you get the new url?
"Alexey Smirnov" <al************ @gmail.comwrote in message
news:11******** *************@q 40g2000cwq.goog legroups.com...
On Mar 10, 3:28 pm, "Smokey Grindel" <nos...@nospam. comwrote:
>Right now I am posting data to a webpage by doing the following

webRequest =
CType(System.N et.WebRequest.C reate("http://www.domain.com/login.asp"),
Net.HttpWebReq uest)

webRequest.Met hod = "POST"

webRequest.Coo kieContainer = Cookies

postData = "Submit=Go&id=a sdDSDFsdf&pid=3 4g4"

data = System.Text.Enc oding.UTF8.GetB ytes(postData)

webRequest.Con tentType = "applicatio n/x-www-form-urlencoded"

webRequest.Con tentLength = data.Length

Dim RequestStream As IO.Stream = webRequest.GetR equestStream

RequestStream. Write(data, 0, data.Length)

RequestStream. Close()

webResponse = CType(webReques t.GetResponse() , Net.HttpWebResp onse)

Now when I send that, the response is a new webpage (it redirected to it
after it authenticated my login account) I dont want to get the entire
page
retured, I just want the URL that the new page is on, is there any way to
do
this with out downloading the entire response (its large and a waste of
bandwidth since all I need is just the URL)... the URL is in the format
ofhttp://www.domain.com/nextpage.asp?GU ID=45T45G45G45G 45G45WGREGDG

Any help would be nice, thanks!

You have to get the entire response to find the url, I think. Or you
have to know your GUID

Mar 10 '07 #3

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

Similar topics

4
2734
by: Max | last post by:
Hello. This is the first time I've posted to a newsgroup, and I do this because I'm in desperate need of help. I'm working a user management system, and when I activate a user that has registered to my system, the current admin user logged in gets logged out. I can't seem to work out how - I can't even trace back where some of the variables are coming from (for example, the "ref" part of the Request.QueryString method). Could someone...
6
2291
by: Agoston Bejo | last post by:
Hi. x1.asp: <form method="post" action="x2.asp"> .... </form> x2.asp: DoSomeAdministration() Response.Redirect "x3.asp?" & Request.Form x3.asp: further processsing of data
7
28555
by: Ivan Demkovitch | last post by:
Hi! Here is what I'm doing: I have Login.aspx with code to do forms authentification and I have this line at the end: Response.Redirect(Request.UrlReferrer.ToString()); I have other (non-ASP.NET) pages that post to Login.aspx. THis way I accomplish asp.net authentification.
6
3804
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length is more that 1249 bytes, then the progress bar of the browser will move too slow and then displaying that the page not found!!!! If the message is less than or equal to 1249 then no problem.
2
4870
by: ad | last post by:
I have tree web page A.ASPX, B.ASPX and CheckPW.aspx There is a button in A.ASPX, the click of that button is redirect to B.ASPX .. I write a Page_Load event in b.aspx, if the Session is null then redirect to CheckPW.aspx to check the password. There is a text box and button in CheckPW.aspx, I write an Click event in CheckPW.aspx: If password is correct
0
1119
by: Daatmor | last post by:
Hi, I've worte a program that will grab the html file content from web server. It's work ------------------------------------------------------------------------------------------------------------------------------ string strURL = "http://127.0.0.1/webapp/requestview.aspx?id=1185"; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(strURL); HttpWebResponse response = null; NetworkCredential credentials = new...
7
9297
by: Carl | last post by:
these are three files below : submit.html <html> <head> </head> <body> <form action="redirect.php" method="POST" > <input type="text" name="value" value="test" > <input type="submit" > </form>
12
2142
by: Mark Rae | last post by:
Hi, See the previous thread Request.Form abuse in this newsgroup... I'm looking for a simple and efficient way to prevent people hijacking the <formtags on my websites and using them to send spam. I would imagine they're using the HttpWebRequest method for this. Essentially, it would require a property on a WebForm that indicates whether it is *only* for PostBack (true by default, but configurable), which would
1
4464
by: Joe | last post by:
In ASP.NET 1.1 I could detected expired form authentication tickets (which closely coincide with my expired session) by checking for the Authentication Cookie when the login screen loads. If the cookie exists, then decrypt the forms auth. ticket and check to see if it is expired. If so display a message to the user letting them know why they are back on the login screen. The code I used was something like this: Dim cookie as HttpCookie...
2
1707
by: Water Cooler v2 | last post by:
Normally, in ASP.NET applications, we read from a Request object and write to the Response buffer. However, I wish to read the request object, do some validations on it, and route the request to a proxy server. How is routing a request to a proxy server achieved in ASP.NET?
0
8683
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
9170
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8904
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8876
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...
1
6531
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
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
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
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

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.