2011-09-02 80 views
0

我有一个应用程序,我可以发布到用户的墙上,当他们允许它。但是,当应用程序发布墙贴时,它会显示它来自我(应用程序管理员)张贴在用户的墙上。我希望它看起来就像是对自己的墙上实际用户发布...(使用VS 2008,NET 3.5的)发布到用户的墙上,好像它是发布

这里是我的代码...

Dim oFB As Facebook.FacebookClient 
    Dim sAppId As String = "my app id" 
    Dim sAppSecret As String = "it's a secret" 

    Dim webClient As System.Net.WebClient = New System.Net.WebClient() 
    Dim result As String = webClient.DownloadString("https://graph.facebook.com/oauth/access_token?client_id=" & sAppId & "&client_secret=" & sAppSecret & "&grant_type=client_credentials") 

    '- Access token changes every hour 
    oFB = New Facebook.FacebookClient(sAppId, sAppSecret) 

    oFB.AccessToken = result.Substring(result.IndexOf("=") + 1) 

    Dim oPost As Collections.Generic.IDictionary(Of String, Object) 
    oPost = New Collections.Generic.Dictionary(Of String, Object) 
    oPost.Add("message", "(websitepipeline test post) Check out this new product!") '- This is the wall post/the description input for the DM function 
    oPost.Add("link", "http://www.example.com/content/somepage.html") 
    oPost.Add("from", "the user who authenticated") 
    oFB.Post("the user who authenticated/feed", oPost) 
+0

等待等待...您是否在制作垃圾邮件应用程序> :( – Daniel

+0

我正在使用facebook sdk(http://facebooksdk.codeplex.com/)。我只发布用户选择的内容验证我的应用程序,我会检查你的(丹)发布的链接。 – Brian

回答

0

这里有一个链接一个为.NET制作的图书馆,它环绕着它;)[link] http://www.lagorio.net/windows/facebook/)显然你需要提供一个FBDialog,当然要求用户提供他的凭证! :)不太确定你使用的是什么库,但可能是“from”的字符串不正确或需要成为某种用户令牌

使用.setStatus命令带有此API。

+0

这一个工程,但它的一切正面发布“是...”:( – Brian

+0

是不是有:includesVerb参数setStatus?不会删除它吗?_fbService.Users.SetStatus(text,/ * includesVerb */true); – dan

+0

Sweet!就是这样... Parameters.Add(“status_includes_verb”,True) – Brian