Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6185361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:41:46+00:00 2026-05-24T01:41:46+00:00

Good evening! I’m developing a web application with asp.net C#. In this application the

  • 0

Good evening!
I’m developing a web application with asp.net C#. In this application the user has the option to create a login using its facebook account (facebook connect).

I’m using thye facebook C# sdk from codeplex (http://facebooksdk.codeplex.com/).
I can easily retrieve the name, photo , etc…. but I don’t know how to retrieve the user e-mail.

To call the FB login button I use this code:

<fb:login-button onlogin="window.location.reload()" perms='email'></fb:login-button>      

It works just fine and to retrieve user’s info I use this C# code:

            // Authenticated, created session and API object
        sessaoFB = new ConnectSession(APPLICATION_KEY, SECRET_KEY);   

        if (!sessaoFB.IsConnected()) {
            this.phLogar.Visible = true;
            this.phLogado.Visible = false;
        } else {

            // Authenticated, create API instance
            _facebookAPI = new Api(sessaoFB);
            Auth auth = new Auth(sessaoFB);

            if (!this.Page.IsPostBack)
            {
                this.phLogar.Visible = false;
                this.phLogado.Visible = true;

                try
                {
                    //User data
                    user usuarioFB = _facebookAPI.Users.GetInfo();
                    this.lblNome.Text = usuarioFB.first_name;                        
                    imgFoto.ImageUrl = usuarioFB.pic_big;                        
                }
                catch (Exception ex)
                {
                    this.lblNome.Text = ex.Message;
                }

            }
        }

How can I get the user’s e-mail suing the facebook C# sdk? Do any of you guys know?

Thanks in advance for any help!
Best regards.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T01:41:47+00:00Added an answer on May 24, 2026 at 1:41 am

    André,

    Your login-buttons is already requesting the permission to access the email address.

    Why don’t you use the FacebookClient? If you’re running .NET 4.0, it’s so simple as this:

    var client = new FacebookClient();
    dynamic me = client.Get("me");
    string firstName = me.first_name;
    string lastName = me.last_name;
    string email = me.email;
    

    Check this documentation: http://facebooksdk.codeplex.com/wikipage?title=Code%20Examples&referringTitle=Documentation

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good evening/morning/after/noon. I have an ASP.net 3.5 website and I am using vb.net in
Good evening/morning/after/noon. I have an ASP.net 3.5 website and I am using vb.net in
Good Evening All, A client has asked that I develop a web application as
Good afternoon, This should be an easy one. I've done the cookie-cutter default ASP.NET
Good day, We just converted our web application .NET 1.1 to .NET 2.0. We
Good evening I've got a little problem with my DataGridView in a .NET Windows
Good morning, afternoon, evening or night (depending on your timezone). This is just a
Good evening :) I'm playing around with g++ and makefiles. I've gotten to this
Good evening, In my app that I'm currently developing, I have a class that
Good evening everyone, I am using a JavaScript to load/override content from an HTML-File

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.