Exemple #1
0
        private void WebBrowserNavigated(object sender, WebBrowserNavigatedEventArgs e)
        {
            // get token
            string url = e.Url.Fragment;

            if (url.Contains("access_token") && url.Contains("#"))
            {
                // this.Hide();
                url = (new Regex("#")).Replace(url, "?", 1);
                string at = System.Web.HttpUtility.ParseQueryString(url).Get("access_token");
                if (!at.Equals(""))
                {
                    this.AccessToken = at;
                    this.Hide();

                    FacebookPublishForm fpf = new FacebookPublishForm();
                    fpf.AccessToken = at;
                    fpf.Type        = this.Type;
                    fpf.PageID      = Settings.Default.FacebookPageID;
                    fpf.Show();
                } // end if()
            }     // end if()
        }
        private void WebBrowserNavigated(object sender, WebBrowserNavigatedEventArgs e)
        {
            // get token
            string url = e.Url.Fragment;

            if (url.Contains("access_token") && url.Contains("#"))
            {
                // this.Hide();
                url = (new Regex("#")).Replace(url, "?", 1);
                string at = System.Web.HttpUtility.ParseQueryString(url).Get("access_token");
                if (!at.Equals(""))
                {
                    this.AccessToken = at;
                    this.Hide();

                    FacebookPublishForm fpf = new FacebookPublishForm();
                    fpf.AccessToken = at;
                    fpf.Type = this.Type;
                    fpf.PageID = Settings.Default.FacebookPageID;
                    fpf.Show();
                } // end if()
            } // end if()
        }