TAILIEUCHUNG - File Input and Output

For information to be saved permanently on a disk, you can use a file. The file is a stream of characters or a flow of related data. Streams enable you to write and read bytes to and from a storage medium, respectively. Streams can be used to perform fundamental operations such as read and write. This chapter introduces the concept of the file input and output operations. It explains the process of reading and writing in the text files and the binary files. It also explains the process of browsing through the Windows File System. . | File Input and Output For information to be saved permanently on a disk you can use a file. The file is a stream of characters or a flow of related data. Streams enable you to write and read bytes to and from a storage medium respectively. Streams can be used to perform fundamental operations such as read and write. This chapter introduces the concept of the file input and output operations. It explains the process of reading and writing in the text files and the binary files. It also explains the process of browsing through the Windows File System. Objectives Chapter 9 In this chapter you will learn to fl Implement the file input and output operations fl Implement read and write in text files fl Implement read and write in binary files fl Implement the Windows File System Implementing the File Input and Output Operations All programs accept input from a user process the input and produce an output. Therefore all the programming languages support the input and output operations. For information to be saved permanently on a disk you can use a file. The file is a collection of data stored on a disk with a specific name and very often with a directory path. When you open the file for reading data or writing data it becomes a stream. The stream is a sequence of bytes travelling from a source to a destination over a communication path. The two basic streams used are the input and output streams. Each stream has a particular function. An input stream is used for a read operation and an output stream is used for performing a write operation. You can perform both these operations over the stream. The namespace includes various classes which are used to perform operations such as file creation file deletion and the read-write operations to files. The following table describes some commonly used classes in the System. IO namespace. Class Name Description FileStream Is used to readfrom and write to any location within a file BinaryReader Is used to read primitive .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.