1
public Form1()
        {
            InitializeComponent();

            // The application key of the Facebook application used
            fbService.ApplicationKey = "XXXXXXXXXXX";

            // Add all needed permissions
            List<Enums.ExtendedPermissions> perms = new List<Enums.ExtendedPermissions>
            {
               Enums.ExtendedPermissions.none
        };
            fbService.ConnectToFacebook(perms);   //error here (The given key was not present in the dictionary.)         
        }

我提到了我收到错误的错误,因为我是 facebook api 的新手,特别是 c# 的新手,任何解释的答案都是适用的 谢谢

4

1 回答 1

0

像这样在 FacebookClient 上使用静态方法:

FacebookClient.SetDefaultHttpWebRequestFactory(uri => {
    var request = new HttpWebRequestWrapper((HttpWebRequest)WebRequest.Create(uri));
    request.Proxy = ......; // normal .net IWebProxy
    return request;
});

另请参阅此答案:Facebook SDK 代理设置 C#

于 2013-03-18T01:50:43.163 回答