Reputation: 2237
Hey guys I am using a webrower to get an access token to a website. The website redirects the webrower to a url containing the access token the redirected url looks like this:
in the DocumentCompleted event for my webrowser I am using this code:
Dim pretoken As String
Dim url As String = WebBrowser1.Url.ToString
If url.Contains("myurl.us") Then
pretoken = WebBrowser1.Url.ToString
MessageBox.Show(pretoken)
End If
The message box only shows "myurl.us" and not the full url with the token i need. Anyway to get the whole url from the webbrowser?
Upvotes: 1
Views: 3624
Reputation: 9322
Have you tried Url.AbsoluteUri.ToString()
, like:
Dim url As String = WebBrowser1.Url.AbsoluteUri.ToString()
Be careful with AbsoluteUri
it's not AbsoluteUrl
Upvotes: 1
Reputation: 2566
Dim sPagePath As String = System.Web.HttpContext.Current.Request.Url.AbsolutePath
Upvotes: 1