Dim url As String = "http://task.zbj.com/t-rjkf/?t=5"
Dim web As new System.Windows.Forms.WebBrowser
web.ScriptErrorsSuppressed = True
web.Navigate(url)
Do While web.ReadyState <> 4
Application.DoEvents
Loop
Dim biaoti As String
Dim neirong As String
Dim trs = web.Document.GetElementsByTagName("table")(0).GetElementsByTagName("tr")
For j As Integer = 1 To trs.count - 1
Dim tr = trs(j)
Dim tds = tr.GetElementsByTagName("td")(0).GetElementsByTagName("p")
Dim tds1 = tr.GetElementsByTagName("td")(0).GetElementsByTagName("p")(0).GetElementsByTagName("a")
biaoti = tds1(0).innerhtml
neirong = tds(1).innerhtml
Dim dr111 As DataRow = DataTables("猪八戒").Find("标题 = '" & biaoti & "' and 内容 = '" & neirong & "'")
If dr111 IsNot Nothing Then '如果找到的话
Else
Tables("猪八戒").AddNew()
Tables("猪八戒").Current("录入时间") = Date.Today()
Tables("猪八戒").Current("标题") = biaoti
Tables("猪八戒").Current("内容") = neirong
Tables("猪八戒").Current("信息状态") = "未发送"
End If
Next
DataTables("猪八戒").Save()
Dim drs As List(Of DataRow)
Dim txt As String = ""
drs = DataTables("猪八戒").Select("[信息状态] = '未发送'")
For Each dr As DataRow In drs
dr("信息状态") = "已发送"
biaoti = dr("标题")
biaoti = biaoti.Replace("+","").Replace("^","").Replace("%","").Replace("~","").Replace("(","").Replace(")","").Replace("[","").Replace("]","")
neirong = dr("内容")
neirong = neirong.Replace("+","").Replace("^","").Replace("%","").Replace("~","").Replace("(","").Replace(")","").Replace("[","").Replace("]","")
txt = txt & "名称:" & biaoti & vblf
txt = txt & "内容:" & neirong & vblf
Next
DataTables("猪八戒").Save()
If txt <> "" Then
txt = txt & vbcr
'txt = txt & "%(c)"
Dim Proc As New Process
Proc.File = "tencent://Message/?menu=yes&exe=&uin=38585830" '红色部分为QQ号
Proc.Start()
System.Threading.Thread.Sleep(2000)
Sendkeys.Send(txt)
End If