我正在制作一个skype机器人,使用Skype4COMLib,但我不能让我的解析器工作!
Private Sub oSkype_MessageStatus(pMessage As ChatMessage, Status As TChatMessageStatus) Handles oSkype.MessageStatus
If Status = TChatMessageStatus.cmsReceived Or Status = TChatMessageStatus.cmsSent Then
Dim Msg As String = pMessage.Body
Dim c As Chat = pMessage.Chat
If Msg.StartsWith("~~~~~~~~~ SDMbae ~~~~~~~~~" + vbNewLine + "SDMbae: Resolving user ") Then
Try
Dim request As HttpWebRequest = HttpWebRequest.Create("My API key is here" + Msg.Split(" ")(5))
Dim response As HttpWebResponse = request.GetResponse
Dim source As String = New IO.StreamReader(response.GetResponseStream).ReadToEnd
pMessage.Body = "~~~~~~~~~ SDMbae ~~~~~~~~~" + vbNewLine + "SDMbae: IP for " + Msg.Split(" ")(5) + " is: " + source.Split(",")(0) + vbNewLine + "SDMbae: Other IPs are " + source.Remove(0, source.Split(",")(0).Length + 1).Split("|")(0).Replace(",", " and ") + vbNewLine + "~~~~~~~~~~~~~~~~~~~~~~"
Catch ex As Exception
pMessage.Body = "~~~~~~~~~ SDMbae ~~~~~~~~~" + vbNewLine + "SDMbae: Error resolving user " + Msg.Split(" ")(5) + vbNewLine + "~~~~~~~~~~~~~~~~~~~~~~"
End Try
End If
谁能帮助我?