• Log in or sign up for an account here: https://www.sythe.org/login

Vb 2008 or 2005 dont care, Question

X Zero

Forum Addict
Joined
Jan 21, 2007
Sythe Gold
0
Messages
577
Location
Australia, The South
NEW QUESTION

Any idea Why

Code:
WebClient.DownloadFileAsync

Doesnt work in vista, but it does in xp?

Code:
WebClient.DownloadFile

Works in both but I don't want to block the thread


______

Old Question





Dont know what to call it but ill explain what im trying to do and its probs easy but yeah.


I have a URL(a) and it redirects to another URL(b).

How could I get url(B) with out using a web browser if possible?

And Url(b) Changes.

I have tried using Net.Webclient but sort of failed. Any help would be wonderful
 
Member of the Month Winner
Sythe's 10th Anniversary
Dont know what to call it but ill explain what im trying to do and its probs easy but yeah.


I have a URL(a) and it redirects to another URL(b).

How could I get url(B) with out using a web browser if possible?

And Url(b) Changes.

I have tried using Net.Webclient but sort of failed. Any help would be wonderful
If the redirect code is in the page itself, you could always find it and parse it by downloading the page with WebClient. Otherwise, you could do a cheap job and make an invisible webbrowser, navigate and get the url from it. Just set the visible property to false.
 
Two Factor Authentication User
You can use a web request to check for redirection headers. This works for things like Tiny URL, but not JavaScript redirection.

Code:
Public Function GetRedirectionUrl(ByVal Url As String) As String
    Dim Request = TryCast(Net.WebRequest.Create(Url), Net.HttpWebRequest)
    If Request Is Nothing Then Return Nothing
    Request.AllowAutoRedirect = False
    Return Request.GetResponse.Headers("Location")
End Function
 
Thanks swan and flaming idiots

I didnt really wanna use the invisible web browser, it seemed tacky and unreliable.

But that GetRedirectionUrl function works like a charm, ur a genius

NEW QUESTION SEE FIRST POST
 
Runescape Gamblingrunescape gambling
Back
Top