Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我想将我的Facebook帐户的帖子恢复到simple table,但我面临一些问题_Facebook_Get_Httpwebrequest_Posts - Fatal编程技术网

我想将我的Facebook帐户的帖子恢复到simple table,但我面临一些问题

我想将我的Facebook帐户的帖子恢复到simple table,但我面临一些问题,facebook,get,httpwebrequest,posts,Facebook,Get,Httpwebrequest,Posts,我正在使用C#和ASP.NET编写代码。我不希望用户被迫登录并授权我的facebook应用程序,因此我编写了以下代码以获取我的令牌,该令牌工作正常: HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("https://graph.facebook.com/oauth/access_token?client_id=MYID&client_secret=MYSECRET&user_id=MYUSE

我正在使用C#和ASP.NET编写代码。我不希望用户被迫登录并授权我的facebook应用程序,因此我编写了以下代码以获取我的令牌,该令牌工作正常:

        HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("https://graph.facebook.com/oauth/access_token?client_id=MYID&client_secret=MYSECRET&user_id=MYUSERID&grant_type=client_credentials");
        myRequest.Method = "GET";
        WebResponse myResponse = myRequest.GetResponse();
        StreamReader sr = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8);
        string result1 = sr.ReadToEnd();
        sr.Close();
        myResponse.Close();
        string token = result1.Substring(13, result1.Length - 13);
然后我写了这段代码来获取我最近的帖子:

        HttpWebRequest myRequest1 = (HttpWebRequest)WebRequest.Create(string.Format("{0}{1}","https://graph.facebook.com/app/posts?access_token=",token));
        myRequest1.Method = "GET";
        WebResponse myResponse1 = myRequest1.GetResponse();
        //StreamReader sr1 = new StreamReader(myResponse1.GetResponseStream(), System.Text.Encoding.UTF8);
        StreamReader sr1 = new StreamReader(myResponse1.GetResponseStream());
        string result2 = sr1.ReadToEnd();
        sr1.Close();
        myResponse1.Close();
如何将此JSON对象快速转换为表?

重复和前面的SO问题?