VBS_网址批量生成器

Posted on 2008-04-13 21:52 ChinaBUG[iPodMP.com] 阅读(80) 评论(0)  编辑  收藏 所属分类: 技术文章

dim templet,filename
filename = "MMKao"
box_default = "http://mm.com/taotu/(*1)/images/mmkao(*2)_jpg.jpg"
box_content = "使用说明:" + vbCrLf + "仅支持二级通配."
box_title = "网址批量生成器 Ver 2.0"
templet = inputbox(box_content,box_title,box_default)

Dim iCount_1 : iCount_1=3
Dim iCount_2 : iCount_2=1

set JetCarCatch=CreateObject("JetCar.Netscape")
if err<>0 then
 MsgBox("FlashGet not properly installed!"+ vbCrLf+"Please Install FlashGet again")
end if

for i=1 to 2
 templet = replace(templet,"(*2)",addStr(i,iCount_2))
 Dim params(200)
 params(0) = "abc.jpg"
 for j=1 to 99
  params(j) = replace(templet,"(*1)",addStr(j,iCount_1))
  params(j+1) = addStr(j,iCount_1)
 next
 JetCarCatch.AddUrlList params
next


'WriteTxtfile "C:\"&filename&".txt",str
msgbox "OK~~"

 

 

' 写入文本文件的子程序
sub WriteTxtfile(thedatafile,texts)
 'on error resume next
 set fso=CreateObject("Scripting.FileSystemObject")
 set thefile=fso.CreateTextFile (thedatafile)
 thefile.write(texts)
 thefile.close
 set thefile=nothing
 set fso=nothing
end sub
' 读取文本文件的自定义函数
function ReadTxtfile(thedatafile)
 on error resume next
 set fso=CreateObject("Scripting.FileSystemObject")
 set thefile=fso.OpenTextFile (thedatafile)
 ReadTxtfile=thefile.readall
 thefile.close
 set thefile=nothing
 set fso=nothing
end function
' 添加前缀符号
function addStr(str,count)
 lens=count-len(str):if lens<=0 then lens=0
 str_tmp=String(lens,"0")
 addStr=str_tmp&str
end function

Copyright © ChinaBUG[iPodMP.com]