Facebook ASP.NET编码问题(试图使CodePlex示例工作)

时间:2009-08-02 19:41:33

标签: asp.net facebook

我正在尝试使用以下代码:

Imports Microsoft.VisualBasic  
Imports System
Imports System.Data
Imports System.Configuration
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports System.Collections.ObjectModel
Imports Facebook
Imports Facebook.WebControls

Public Partial Class _Default
    Inherits CanvasIFrameBasePage
    Private Const FACEBOOK_API_KEY As String = "xxxxxxxxxx"
    Private Const FACEBOOK_SECRET As String = "yyyyyyyyyy"

    Shadows Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        MyBase.Api = FACEBOOK_API_KEY
        MyBase.Secret = FACEBOOK_SECRET
        MyBase.Page_Load(sender, e)

        If (Not IsPostBack) Then
            Try
                ' Use the FacebookService Component to populate Friends
                Dim u As Facebook.Entity.User = Me.FBService.GetUserInfo()

                Dim f As Collection(Of Facebook.Entity.User) = Me.FBService.GetFriends()


                Dim s As String = ""
                If f.Count <> 1 Then
                    s = "s"
                End If
                lblHelloWorld.Text = "Hello " & u.Name & " you have " & f.Count & " friend" & s & "..." & Me.FBService.SessionKey
                Me.FBService.SetFBML("Hello " & u.Name & " you have " & f.Count & " friend" & s)
            Catch e1 As Exception
                'Throw
            End Try
        End If
    End Sub
End Class

但我一直收到错误:

  

未找到请求值“网络”。

在这条线上失败了:

Dim u As Facebook.Entity.User = Me.FBService.GetUserInfo()

有人可以帮忙吗?

它被称为Facebook工具包,位于http://facebooktoolkit.codeplex.com/

0 个答案:

没有答案