asp.net - Facebook .net 开发工具包 - setinfo

标签 asp.net vb.net facebook

我正在使用 Facebook 开发工具包,但无法让 profile.setinfo 工作。该文档没有用。我正在使用最新的源 - 28656。

有人可以为我发布一个 VB.Net 示例吗?

更新:有人问我一个具体问题,所以这里是:

Setinfo 获取一个列表(来自 facebook.Schema.info_field)

并且 info_field 应该获取一个列表(来自 facebook.Schema.info_item)

但它似乎需要一个 itemsLocalType 来代替。所以错误是

Unable to cast object of type 'System.Collections.Generic.List`1[facebook.Schema.info_item]' to type 'itemsLocalType'.

最佳答案

我终于自己解决了:

Dim items = New facebook.Schema.info_field.itemsLocalType     
items.info_item.add(New Schema.info_item With {.label = "Happy", .image = "http://imageurl1/", .sublabel = "", .description = "The original and still undefeated.", .link = "http://www.scottstonehouse.ca/blog"})

items.info_item.Add(New Schema.info_item With {.label = "Indifferent", .image = "http://imageurl2/", .sublabel = "", .description = "meh....", .link = "http://www.scottstonehouse.ca/blog"})

items.info_item.Add(New Schema.info_item With {.label = "Sad", .image = "http://imageurl3/", .sublabel = "", .description = "Oh my god! you killed my dog!", .link = "http://www.scottstonehouse.ca/blog"})

items.info_item.Add(New Schema.info_item With {.label = "Cool", .image = "http://imageurl4/", .sublabel = "", .description = "Yeah. whatever", .link = "http://www.scottstonehouse.ca/blog"})

Dim ifields = New List(Of facebook.Schema.info_field)()

ifields.Add(New facebook.Schema.info_field With {.field = "test field name", .items = items})

_fbService.API.profile.setInfo("Info Title", 5, ifields, _fbService.API.uid)

关于asp.net - Facebook .net 开发工具包 - setinfo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/548343/

相关文章:

asp.net - 通过文件上传控件上传时在 c#.net 中重命名文件,并将文件的更改名称保存在数据库中

asp.net - asp按钮上的JS回调

javascript - 从后面的代码加载js setTimeout

c# - 如何在没有边框的窗体周围添加阴影?

asp.net - 什么是 asp.net mvc 的理想候选人

.net - 如何更改 DataGridView 列的宽度

android - facebook sdk 4.1 for android : how to handle token expiration

ios - 如何知道该用户的哪些Facebook friend 已安装我的应用程序?

Facebook API : Get fans of/people who like a page

vb.net - 当应用程序搜索数据库时添加旋转轮