Exemplo n.º 1
0
        /// <summary>
        /// Send http request to facebook and get the information.
        /// </summary>
        /// <param name="i_Sender">Object sender</param>
        /// <param name="i_Event">The event</param>
        private void fbBlueButtonLogin_Click(object i_Sender, EventArgs i_Event)
        {
            LoginResult result = FacebookService.Login(
                "904603836301816", 
                "user_friends", 
                "email", 
                "user_likes", 
                "publish_actions", 
                "user_posts",
                "public_profile", 
                "user_events", 
                "user_about_me", 
                "user_birthday", 
                "user_hometown", 
                "user_photos");

            if (!string.IsNullOrEmpty(result.AccessToken))
            {
                try
                {
                    Form appUi = new FormMainWindow(result);
                    this.Hide();
                    appUi.ShowDialog();
                }
                finally
                {
                    Application.Exit();
                }
            }
            else
            {
                MessageBox.Show(result.ErrorMessage);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Send http request to facebook and get the information.
        /// </summary>
        /// <param name="i_Sender">Object sender</param>
        /// <param name="i_Event">The event</param>
        private void fbBlueButtonLogin_Click(object i_Sender, EventArgs i_Event)
        {
            LoginResult result = FacebookService.Login(
                "904603836301816",
                "user_friends",
                "email",
                "user_likes",
                "publish_actions",
                "user_posts",
                "public_profile",
                "user_events",
                "user_about_me",
                "user_birthday",
                "user_hometown",
                "user_photos");

            if (!string.IsNullOrEmpty(result.AccessToken))
            {
                try
                {
                    Form appUi = new FormMainWindow(result);
                    this.Hide();
                    appUi.ShowDialog();
                }
                finally
                {
                    Application.Exit();
                }
            }
            else
            {
                MessageBox.Show(result.ErrorMessage);
            }
        }