vb.net写的半自动发文章软件

最近工作重点主要是发外媒的软文外链,工作量比较大所以想写一个小工具减轻下

本来想写一个直接post的软件,可惜还要抓包什么的,博主对此一窍不通,只好写一个类似于自动填表的东西,减少下复制粘贴的手动过程

大致步骤是 读取数据库内文章,然后列表,点击列表内文章自动填表。
Imports System.Data
Imports System.Data.OleDb

Public Class data ‘连接Access 数据
Dim recno As Integer
Dim str As String = System.IO.Directory.GetCurrentDirectory & “\dbCustomer.mdb”
Dim con As New OleDbConnection(“provider=microsoft.jet.oledb.4.0;data source='” & str & “‘”)
Dim cmd As New OleDbCommand(“Select * from tblcustomer”, con)
Dim da As New OleDbDataAdapter(cmd)
Dim ds As New DataSet()

Private Sub data_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
da.Fill(ds, “tblcustomer”)
DataGridView1.DataSource = ds.Tables(“tblcustomer”) ‘读取文章数据到DataGridView控件
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Navigate(TextBox1.Text)
End Sub
Public sTemp(99) As String
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
If e.ColumnIndex < 0 Or e.RowIndex < 0 Then Exit Sub ‘点击自动填表
ReDim sTemp(99)
sTemp(0) = DataGridView1.Item(0, e.RowIndex).Value
sTemp(1) = DataGridView1.Item(1, e.RowIndex).Value
sTemp(2) = DataGridView1.Item(2, e.RowIndex).Value
WebBrowser1.Document.All(“title”).SetAttribute(“value”, sTemp(1))
My.Computer.Clipboard.SetText(sTemp(2)) ‘因为内容不能写入,只好复制到剪切板来用,多了一个粘贴的过程
End Sub
End Class

《vb.net写的半自动发文章软件》有2个想法

发表评论

电子邮件地址不会被公开。 必填项已用*标注