V
V
Victor2016-06-01 19:57:31
C++ / C#
Victor, 2016-06-01 19:57:31

How to determine the url address of the open page?

There is a web browser on the form, the url (VK authorization) opens in it, after authorization there is a transition to the page, the address of this page contains an access token, how to get it out of there? Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michael, 2016-06-01
@victoriously

webbrowser.Navigated += (sendr, ee) =>
            {
                if (ee.Uri.ToString().Contains("https://oauth.vk.com/blank.html#access_token="))
                {
                    token = ee.Uri.ToString().Substring(45);
                    token = token.Remove(token.IndexOf('&'));
                }
            };

This is a simple example of getting a vk.com token.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question