用vbs实现随机读取文件的一行内容的脚本
发布时间:2016-12-28 来源:查字典编辑
摘要:复制代码代码如下:randomizesetfso=createobject("scripting.filesystemobject")set...
复制代码 代码如下:
randomize
setfso=createobject("scripting.filesystemobject")
seta=createobject("scripting.dictionary")
setfile=fso.opentextfile("a.txt")
dowhilefile.atendofstream<>true
m=m+1
a.addm,file.readline
loop
file.close
h=int(rnd*m)
msgbox"第"&h&"行:"&a(h),4096,"随机内容"