这段代码扔TwitterAPIException
在这条线上
profilepic.ImageLocation = twitter.AccountInformation.ProfileImageUrl
我有一种感觉,可能是因为它没有进行身份验证,但我不确定。知道为什么我可能会得到这个,我如何在我的代码中检查 twitter 在尝试实际读取数据之前是否对我进行了身份验证?
我已删除私钥以保护隐私
Imports TwitterVB2
Public Class Form1
Dim twitter As New TwitterAPI
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles verify_btn.Click
twitter.AuthenticateWith("", "", "", "")
profilepic.BackColor = Color.White
profilepic.ImageLocation = twitter.AccountInformation.ProfileImageUrl
tw_name.Text = "HI" + twitter.AccountInformation.Name
For Each Tweet As TwitterStatus In twitter.HomeTimeline
tweets.AppendText(vbNewLine + vbNewLine + Tweet.User.ScreenName + vbNewLine + Tweet.Text + vbNewLine + Tweet.CreatedAtLocalTime + vbNewLine + vbNewLine + "..............................")
Next
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tw_name.Click
End Sub
Private Sub profilepic_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles profilepic.Click
End Sub
End Class