The usage of ReadLine method under VBS
This article mainly introduces "the usage of ReadLine method under VBS". In the daily operation, I believe that many people have doubts about the usage of ReadLine method under VBS. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "the usage of ReadLine method under VBS". Next, please follow the editor to study!
Reads an entire line of characters from the TextStream file (up to the next line, but not the next line) and returns the result string.
Object.ReadLine
Object should be the name of the TextStream object.
Description
The following example shows how to use the ReadLine method to read characters from a TextStream file and return a string:
Function ReadLineTextFile Const ForReading = 1, ForWriting = 2 Dim fso, MyFile Set fso = CreateObject ("Scripting.FileSystemObject") Set MyFile = fso.OpenTextFile ("c:\ testfile.txt", ForWriting, True) MyFile.WriteLine "Hello world!" MyFile.WriteLine "The quick brown fox" MyFile.Close Set MyFile = fso.OpenTextFile ("c:\ testfile.txt", ForReading) ReadLineTextFile = MyFile.ReadLine 'Returns "Hello world!" End Function, the study of "the usage of ReadLine under VBS" is over, hoping to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!