Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/33.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

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通知发布数据asp.net_Asp.net_Facebook_Post_Notifications - Fatal编程技术网

Facebook通知发布数据asp.net

Facebook通知发布数据asp.net,asp.net,facebook,post,notifications,Asp.net,Facebook,Post,Notifications,我创建了一个facebook应用程序。asp.NETMVC中的一个小游戏。这是一个基于回合的实时游戏,我希望第一个玩家选择他的对手,向他发送facebook通知,然后进入游戏页面。 然后,第二名玩家单击此通知并进入游戏页面。 我的问题是关于post数据的href参数。 在asp.net中,我创建了一个webhttprequest对象。但我必须发布的数据如下: 但当第二个玩家点击通知时,最后两个参数丢失。我想这是因为symbol&与facebook图形地址和我的地址一起使用。如何使用所有参数编写

我创建了一个facebook应用程序。asp.NETMVC中的一个小游戏。这是一个基于回合的实时游戏,我希望第一个玩家选择他的对手,向他发送facebook通知,然后进入游戏页面。 然后,第二名玩家单击此通知并进入游戏页面。 我的问题是关于post数据的href参数。 在asp.net中,我创建了一个webhttprequest对象。但我必须发布的数据如下:

但当第二个玩家点击通知时,最后两个参数丢失。我想这是因为symbol&与facebook图形地址和我的地址一起使用。如何使用所有参数编写正确的postdata

这是我的密码:

public string sendnotificationtoplay(string monid, string prenomMoi, string codetokenjeu)
{
    try
    {
        // variables to store parameter values
        string url = "https://graph.facebook.com/" + monid + "/notifications";
        string autrePrenom = "@[" + monid + "]";
        string texte = "@[" + monid + "] ! " + prenomMoi + " wants to play with you ! \n Click here !";

        // creates the post data for the POST request
        string postData = ("access_token=MYACCESSTOKEN&template=" + texte + "&href=mywebsite.org/Index?ordredemandejeugame=2&codejeuadeux=ds&prenom1=dfdf&prenom2=fdgdfg");

        // create the POST request
        HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
        webRequest.Method = "POST";
        webRequest.ContentType = "application/x-www-form-urlencoded";
        webRequest.ContentLength = postData.Length;

        // POST the data
        using (StreamWriter requestWriter2 = new StreamWriter(webRequest.GetRequestStream()))
        {
            requestWriter2.Write(postData);
        }

        //  This actually does the request and gets the response back
        HttpWebResponse resp = (HttpWebResponse)webRequest.GetResponse();

        string responseData = string.Empty;

        using (StreamReader responseReader = new StreamReader(webRequest.GetResponse().GetResponseStream()))
        {
            // dumps the HTML from the response into a string variable
            responseData = responseReader.ReadToEnd();
        }
        return responseData;`
请帮帮我:)


提前谢谢你

请包含您认为包含问题的代码,以便我们更好地了解您正在做什么。谢谢您,罗伯特!下面是我的代码:我在罗伯特下面添加了我的代码!对于我的回复帖子,我向所有其他人表示歉意。这是我第一次使用这个网站来解决问题。