ProcessID=Plugin.Web.Bind("wqm.exe")
Delay 2000
If ProcessID=0 then
  MessageBox "网页按键精灵没有运行"
  EndScript
End If

//连接数据库
set conn = createObject("adodb.Connection")
conn.connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\粟术英\工具软件\SEO自动\谷歌外链自动\data\data.mdb;Persist Security Info=False"
conn.open 
//创建rs对象
Set rs = createObject("ADODB.Recordset")
Set rs2 = createObject("ADODB.Recordset")



////////////////发布规则//////////////////////////////////
//由选定内容来决定发布目标地址
//1)读取选定内容
Randomize 
r   =   Rnd
pushNum = Form1.InputBox1.Text
selectType = Form1.InputBox2.text
cmdStr = "select top "&pushNum&" * from 内容库"&selectType
cmdStr2 = "select top " & pushNum & " * from 地址库 where 分类属性='" & selectType & "' order by rnd( "   &   r   &   "-id) " 
rs.open cmdStr,conn,1,3
rs2.open cmdStr2, conn, 1, 3

//step1:新建pushNum个页面
For pushNum-1
	Call Plugin.Web.TabNew()
Next

Call Plugin.web.TabGoto(1)
Delay 2000
//step2:转打标签页打开网页
Dim arrClass(50)
m=1
Do  While not  rs2.eof 
arrClass(m) = rs2("分类")
url = rs2("网址")
Call plugin.web.TabGoto(m)
Call Plugin.Web.Go(url)
If not rs2.eof  Then  rs2.movenext
m = m + 1
Delay 2000
Loop
rs2.close 


Delay 30000
//填写内容
i=1
Do  While not rs.eof 
Call Plugin.Web.TabGoto(i)
Delay 10000
    username = rs("username")
    website = rs("website")
    email = rs("email")
    info = rs("info")
    title = rs("title")
selectFun(arrClass(i))
If not rs.eof  Then rs.movenext 
i=i+1
loop
MessageBox i

///////////////发布规则END///////////////////////////////////
Function selectFun(funSelect)
   Select Case funSelect
  	Case "bahnhof"
  	Call bahnhof(url, username, website, email, info)
  	Case "coursdinformatique"
  	Call coursdinformatique(url, username, website, email, info, title)
  	Case "gravidblogg"
  	Call gravidblogg(url, username, website, email, info, title)
  	Case "sokolhovezi"
  	Call sokolhovezi(url, username, website, email, info, title)
  	Case "servercronos"
  	Call servercronos(url, username, info)
  	Case "sununews"
  	Call sununews(url, username, website, email, info, title)
  	Case "jerryghionis"
  	Call jerryghionis(url, username, website, email, info, title)
  	Case "sufehmi"
  	Call sufehmi(url,username,website,email,info,title)
  	Case Else
  	MessageBox("没有对应函数 需要更新函数库")
  End Select
End Function



Function sufehmi(url,username,website,email,info,title)//url网址 username用户名称 website 主页 email邮箱地址 info 内容 title 标题
Call Plugin.Web.Tips("sufehmi")
Delay 1000
Call Plugin.Web.HtmlInput(username,"id:author")
Delay 1000
Call Plugin.Web.HtmlInput(email,"id:email")