Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Controls / December 2004



Tip: Looking for answers? Try searching our database.

Inet1 - getting URL after redirection

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Benson - 28 Dec 2004 11:45 GMT
The Inet1 (Internet Transfer Protocol) control automatically handles a
server redirection (eg 302 object moved generated from, say an ASP
response.redirect) -- ie if you connect to a site and the server redirects
you to another site, Inet1 automatically retrieves data from the site to
which you are redirected.

This is great. However, how can you get the URL of the site you have been
redirected to?  The problem is that the Inet properties (RemoteHost, URL...)
are NOT updated to reflect the URL of the page you end up on. They continue
to show the original URL, which is of zero use, as you already know this.
Knowing the new URL is essential if subsequent posts etc. need to use the
new URL (which might even be a different domain).  The information also does
not appear in the response Headers.  The new URL DOES appear as the
"Location" header in the original 302 response from the server, but I can't
see any way of getting hold of this. ie this is the problem.

Trapping the StateChanged event does not seem to offer a solution. No matter
which State you trap you can't get at the new URL.

I've tried using the handle from the Inet1 hInternet property with the
Wininet API InternetQueryOption but the handle is always invalid. I can't
find any documentation on whether this is meant to work or not so trying it
was  just an unsucesseful stab in the dark.

This is a really simple requirement.  Surely there is a way to tell what URL
you have connected to using the Inet1 control.  If so, what is it?
Veign - 28 Dec 2004 15:28 GMT
Handling HTTP redirection:
http://www.vbip.com/winsock/winsock_http_07_01.asp

Signature

Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
--

> The Inet1 (Internet Transfer Protocol) control automatically handles a
> server redirection (eg 302 object moved generated from, say an ASP
[quoted text clipped - 22 lines]
> This is a really simple requirement.  Surely there is a way to tell what URL
> you have connected to using the Inet1 control.  If so, what is it?
Peter Benson - 28 Dec 2004 20:26 GMT
Veign -- why did you give me that link below? Why did you respond at all?
Your answer was completely irrlevant.  I went to a  lot of trouble carefully
describing my problem with the Inet1 control. Why then post me a link about
redirection with the Winsock Control. It has no bearing on the problem at
all.  My original question shows clearly I understand redirection. I'm
trying to get some information from the Inet1 control, not to find out what
redirection is or what the Windsoc control can do.

I don't want to be rude but clogging up the news groups with completely
irrelevant responses helps nobody.

> Handling HTTP redirection:
> http://www.vbip.com/winsock/winsock_http_07_01.asp
[quoted text clipped - 33 lines]
> URL
>> you have connected to using the Inet1 control.  If so, what is it?
Veign - 28 Dec 2004 20:30 GMT
>> The new URL DOES appear as the
>> "Location" header in the original 302 response from the server, but I
can't
>> see any way of getting hold of this. ie this is the problem.

The code shows how to extract that information out of the header response.

Signature

Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
--

> Veign -- why did you give me that link below? Why did you respond at all?
> Your answer was completely irrlevant.  I went to a  lot of trouble carefully
[quoted text clipped - 44 lines]
> > URL
> >> you have connected to using the Inet1 control.  If so, what is it?
Peter Benson - 28 Dec 2004 20:53 GMT
You again miss the point.  There IS NO HEADER RESPONSE provided by Intet1
that you can use. That's the point of my question.  Have you used the Inet1
control to discover the URL you have been diverted to?  If not, no point in
responsing is there?   If you HAVE used it to do this, then prove that you
understand the question by explaining how to discover where you have been
diverted to.  Your response so far provides no useful information. Please
read my question carefully before responding.

>>> The new URL DOES appear as the
>>> "Location" header in the original 302 response from the server, but I
[quoted text clipped - 62 lines]
>> > URL
>> >> you have connected to using the Inet1 control.  If so, what is it?
Bob O`Bob - 28 Dec 2004 21:08 GMT
> You again miss the point.  There IS NO HEADER RESPONSE provided by Intet1
> that you can use. That's the point of my question.  Have you used the Inet1
[quoted text clipped - 3 lines]
> diverted to.  Your response so far provides no useful information. Please
> read my question carefully before responding.

You said it yourself, in your first message.
The Inet control _automatically_ handles redirection.

Have you considered the possibility that you *can't* get what you now want,
by using that control?

I'm not saying that's necessarily the case, but if it does turn out to be,
then Veign's suggestion is nowhere near "irrelevant"

Meanwhile, you may want to consider what effect your apparent attitude
is having on other people who might have been interested in helping you.
I've never used the Inet control, preferring instead the Winsock, but I
may have been interested enough to investigate, to assist someone asking
similar questions.  Not in this case, though.

    Bob
Peter Benson - 28 Dec 2004 21:22 GMT
Yes, it is indeed possible that the Inet1 control will not provide the
results. But it just might as it's a common requirement. I am trying to find
out if it will.

To simply move directly to talking about other technology with no reference
at all to the technology (eg Inet1) is not helpful.  It's like if you were
to ask a question specifically about Win 98 and the answer comes back about
win xp with no reference to the original Win98 problem.    I know you
haven't used Inet1 (so once again, not sure why you responded) but  moving
from Inet1 to Winsoc for the things one uses Inet1 for is a major
undertaking.  Once again, it would be like you saying you have a formatting
problem in Microsoft Word and somebody comes back and suggests using C++ to
process your document. Not helpful. Neither were Veign's two responses.

And clogging up these newsgroups with off the cuff, irrelevant suggestions
is a major problem.  It makes finidng information difficult. Silence is
usually a far better response.

>> You again miss the point.  There IS NO HEADER RESPONSE provided by Intet1
>> that you can use. That's the point of my question.  Have you used the
[quoted text clipped - 21 lines]
>
> Bob
Veign - 29 Dec 2004 01:11 GMT
You stated that the header contained the information you were interested in
and I responded with a means of getting the information from the header.  I
have used the Inet control but will pass on putting anymore time into this
thread.

Good luck in your search for the answer...

Signature

Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
--

> You again miss the point.  There IS NO HEADER RESPONSE provided by Intet1
> that you can use. That's the point of my question.  Have you used the Inet1
[quoted text clipped - 70 lines]
> >> > URL
> >> >> you have connected to using the Inet1 control.  If so, what is it?
Peter Benson - 29 Dec 2004 01:53 GMT
Yes, you responded. Trouble is the method you describe can't be used to get
header information if you have read the data using the Inet1 control.

So I think you are wise to pass on putting anymore time into this as you
clearly don't understand the issue.

> You stated that the header contained the information you were interested
> in
[quoted text clipped - 95 lines]
>> >> > URL
>> >> >> you have connected to using the Inet1 control.  If so, what is it?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.