我得到这个的代码块是,
If userID > 0 Then
Dim lq As New lqDFDataContext
Dim var = lq.mobile_GetCustomChannels(userID).ToList()
For Each c In var
Dim channel As New SimpleChannel
channel.channelID = c.channelID
channel.userID = c.userID
If c.matchTitle = True Then
channel.matchBy = "Title"
End If
If c.matchTitleAbstract = True Then
channel.matchBy = "Title and Abstract"
End If
If c.fromMyPage = True Then
channel.source = "My Page"
Else
channel.source = "All Journals"
End If
Dim tempKW() As String = c.keywords.Split(",")
For Each kw As String In tempKW
channel.keywords.Add(kw)
Next
Dim imageKW As String = c.keywords.Substring(0, c.keywords.IndexOf(" "))
channel.imageURL = SingleImageSearch(imageKW)
result.Add(channel)
Next
End If
“channel.keywords.Add(kw)”这一行是错误出现的地方。我已经使用这种技术数十次没有问题,这似乎与我使用它的所有其他时间相似,但我不断收到此异常。想不通为什么。