Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report