· 8 years ago · Jan 04, 2018, 09:28 AM
1// Authenticated, created session and API object
2 _connectSession = new ConnectSession(APPLICATION_KEY, SECRET_KEY);
3
4 if (!_connectSession.IsConnected())
5 {
6 // Not authenticated, proceed as usual.
7 qanswername.Text = "Anonym";
8 }
9 else
10 {
11 // Authenticated, create API instance
12 _facebookAPI = new Api(_connectSession);
13
14 // Load user
15 Facebook.Schema.user user = _facebookAPI.Users.GetInfo();
16
17 qanswername.Text = user.name;
18 qanswername1.Text = user.name;
19
20 if (!Page.IsPostBack)
21 {
22 qanswername.Text = user.name;
23 qanswername1.Text = user.name;
24
25 }
26 }