Given a URL A which gets redirected to a 3rd party website B, in my application I need to to find out URL B for the given url A and insert it in DB , this can be a windows application or web or whichever way is faster and easier using C#! Thanks !
P.S. I do not require the code to insert in DB.
WebRequest follows redirects without user intervention, so if the redirects are using 301/302 status codes then the following will work
If the redirects are created using javascript or HTTP-Equiv meta tags then you're doing to have to parse the page and look for those. The HTML agility pack is probably the best way to do this.
To take this a little further the following is a class which will manually resolve the main HTTP redirect status codes, building up a history as it goes
As what I understand from your question you can use a code like this so you can see the previous url and save it into db by using Linq or other ADO.NET methods.
I assume that you know how to save record in db with LINQ. If you don't please follow this link : LINQ to SQL - 5 Minute Overview
Hope it helps.