0
我似乎無法獲取或存儲我創建的發佈消息的ID。我正在使用此代碼發佈消息:來自GetResultData的消息ID
Try
Dim fb = New FacebookClient(_accessToken)
AddHandler fb.PostCompleted, Function(o, e)
If (e.Cancelled) Then
ElseIf e.Error IsNot Nothing Then
MessageBox.Show(e.Error.Message)
Else
Dim result As Object = e.GetResultData()
_lastMessageId = result.Id
End If
Return MessageBox.Show("Message Posted successfully")
End Function
Dim parameters As Object = New ExpandoObject()
parameters.message = TextBox1.Text
fb.PostTaskAsync("me/feed", parameters)
MsgBox("This is the last message id " & _lastMessageId)
Catch ex As FacebookApiException
MessageBox.Show(ex.Message)
End Try
我只想存儲發佈的ID,以便稍後將其刪除。
這裏是我想出了感謝prabir
Dim fb = New FacebookClient(_accessToken)
Dim parameters As Object = New ExpandoObject()
parameters.message = "Testing"
Dim task = fb.PostTaskAsync("me/feed", parameters)
task.ContinueWith(Function(t)
If t.Exception Is Nothing Then
Dim result As Object = t.Result
_lastMessageId = result.id
Else
MsgBox("error occurred")
End If
Return t.Result
End Function)
非常感謝您的快速reply.i有現在的工作不太清楚,如果它的100%,然而,但它確實工作。我似乎可以在這裏發佈工作代碼,但生病繼續嘗試,因爲它可能會幫助別人。感謝 – 2012-02-22 05:18:53