How to use vbs to randomly read one line of a file
This article mainly introduces how to use vbs to achieve random reading of a line of file content, the article is very detailed, has a certain reference value, interested friends must read it!
The code is as follows:
Randomize set fso=createobject ("scripting.filesystemobject") set a=createobject ("scripting.dictionary") set file=fso.opentextfile ("a.txt") do while file.atendofstreamtrue m=m+1 a.add mjournal file.readline loop file.close h=int (rnd*m) msgbox "Line" & h & "Line: & a (h), 4096," Random content "these are all the contents of the article" how to use vbs to randomly read a line of file ". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!