File class

zhaozj2021-02-16  60

File: Ordered collection of permanent data stored on the media, it is the basic object of data read and write operations. Each file has some basic properties, such as file name, storage path, access to access: providing continuous byte streaming control, which is also the basic object of data read and write operations, and the actual control of data in the stream is Not continuous, even can be distributed in multiple deposits

The common way for the FILE class is: AppendText: Create a streamwriter object, add new content at the end of the specified file, if the specified file does not exist, then create this file Copy: Copy Specified File Move: Move the specified file to the new Path Delete: Delete Specified File EXISTS: Determines whether the specified file exists: Use the specified method, permission open Specified File OpenRead: Open the specified file in a read-only manner OpenText: Create a StreamReader object, used to read the specified text file The content OpenWriter: Open the specified file in the way: Create a specified file CreateText: Create a text file

Operation text file

After reading a text file file.opentext (String strpath) After the method is applied, its return value is a StreamReader class. Next, you can use the STREAMReader class to complete read and write to text files.

转载请注明原文地址:https://www.9cbs.com/read-18551.html

New Post(0)