Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / February 2008

Tip: Looking for answers? Try searching our database.

GEt The Response URl

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rajkiran R.B. - 22 Feb 2008 12:36 GMT
Whenever I type some url like

http://youtube.com/watch/v/54GRe3ox_xI

in firefox browser when the address is immediately redirected to

http://youtube.com/swf/l.swf?video_id=54GRe3ox_xI&rel=1&eurl=&iurl=http%3A//i.yt
img.com/vi/54GRe3ox_xI/default.jpg&t=OEgsToPDskJ98NGh0lWiWIogmOD9369L


Is there a way in C# to get the above url

I tried implementing Using The HttpWebRequest And HttpWebResponse Class but
no use

Please Help Me

Regards
Rajkiran
Jon Skeet [C# MVP] - 22 Feb 2008 12:45 GMT
> Whenever I type some url like
>
[quoted text clipped - 9 lines]
> I tried implementing Using The HttpWebRequest And HttpWebResponse Class but
> no use

It should be fine with HttpWebRequest. You should get a 302 back.

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Nicholas Paldino [.NET/C# MVP] - 22 Feb 2008 13:08 GMT
Rajkiran,

   You have to set the AllowAutoRedirect property on the HttpWebRequest
instance to false (the default is true).  When this property is true, it
will automatically redirect the request on a 302 response to the URL
indicated in the 302 response.  This will prevent that from happening and
return the 302 response to you, along with the redirect information.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> Whenever I type some url like
>
[quoted text clipped - 13 lines]
> Regards
> Rajkiran

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
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



©2008 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.