Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use vbs to randomly read one line of a file

Shulou Source: shulou.com Published: 2022-06-03 08:36:26 11月15日 Update

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!

Tags: Content line file article code value interest guy partner more knowledge industry information channel channel reference help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn MySQL Xiaomi Shulou Information Microsoft