Lecture Windows programming: Chapter 8 - Châu Thị Bảo Hà
Số trang: 37
Loại file: pptx
Dung lượng: 260.81 KB
Lượt xem: 10
Lượt tải: 0
Xem trước 4 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Lecture Windows programming - Chapter 8 introduce to the files and streams. In this chapter you will be learn contents: Files and Streams overview, IO namespace and its classes, serialization.
Nội dung trích xuất từ tài liệu:
Lecture Windows programming: Chapter 8 - Châu Thị Bảo HàFiles&StreamsChapter8 Ebook: Beginning Visual C# 2010, chapter 21 Reference: C# How to Program, chapter 17Contents Files and Streams overview IO namespace and its classes SerializationFilesandStreams Files and Streams C# views each file as a sequential stream of bytes each file ends either with: an end-of-file marker specific byte number recorded in a system-maintained administrative data structure When a file is opened, an object is created and a stream is associated with the object when a file is opened two types of streams output inputContents Files and Streams IO namespace and its classes SerializationIOnamespaceanditsclassesClass DescriptionStream Provides a view of the sequence of bytesFile Provides static methods for creating and manipulating filesFileSystemIn Contains methods that are common to file and directoryfo manipulationDirectory Provides methods for creating, moving and enumerating through directories and sub-directoriesDirectoryInfo Provides instance methods for creating, moving and enumerating directories and sub-directoriesTextReader Represents a reader that can read a sequence of charactersTextWriter Represents a writer that can write a sequence of charactersBinaryReade Reads primitive data types as binary values in a specificr encodingBinaryWriter Writes primitive types in binary to a stream and supportsStreamclasses An abstract class from which different classes are derived MemoryStream used to read and write data to memory BufferedStream used to read and write to the buffer FileStream used to perform read and write operations on files NetworkStream used to send and receive data across the network CryptoStream used to link the stream of data to any cryptography object for the purpose of encrypting the dataFileStreamclassconstructors Constructors DescriptionFileStream(string Takes in the path of the file to beFilePath, FileMode) read from or written to and any one of the FileMode enumerator values as its argumentsFileStream(string Takes in the path of the file to beFilePath, FileMode, read from or written to, any one ofFileAccess) the FileMode enumerator values and FileAccess enumerator values as it argumentsEnumeratorsusedwithFileStreamclass FileMode Enumerators FileAccess Append Enumerators Create Read CreateNew Write Open ReadWrite OpenOrCreate TruncateDirectoryandFileclasses The directory class contains static methods that help in handling directories and subdirectories The file class contains static methods that help in handling files it also helps in the creation of FileStream classFilemethods Methods DescriptionCopy( string Used to copy the contents of a source file to aSourcePath, string destination file in the specified path. If theDestinationPath ); destination file does not exist, a new file is created with the specified name in the specified pathCreate( string Path ) Used to create a file with the specified name in the specified pathDelete( string Path ) Used to delete a file from a specified pathExists( string Path ) Used to verify whether a file with the specified name exists in the specified path. It returns a Boolean valueMove( string Used to move the specified file from theSourcePath, string source location to the destination locationDestinationPath )Directorymethods Methods DescriptionCreateDirectory (String Creates all the directories in the specifiedPath) pathDelete( string Path ) Deletes an empty directory from a specified pathExists( string Path ) Checks whether the given path refers to an existing directory on diskMove( string Used to move the specified file from theSourceFilePath, string source location to the destination locationDestinationFilePath )GetCurrentDirectory() Returns the current working directoryGetDirectories ( string Gets the names of subdirectoriesPath)Ge ...
Nội dung trích xuất từ tài liệu:
Lecture Windows programming: Chapter 8 - Châu Thị Bảo HàFiles&StreamsChapter8 Ebook: Beginning Visual C# 2010, chapter 21 Reference: C# How to Program, chapter 17Contents Files and Streams overview IO namespace and its classes SerializationFilesandStreams Files and Streams C# views each file as a sequential stream of bytes each file ends either with: an end-of-file marker specific byte number recorded in a system-maintained administrative data structure When a file is opened, an object is created and a stream is associated with the object when a file is opened two types of streams output inputContents Files and Streams IO namespace and its classes SerializationIOnamespaceanditsclassesClass DescriptionStream Provides a view of the sequence of bytesFile Provides static methods for creating and manipulating filesFileSystemIn Contains methods that are common to file and directoryfo manipulationDirectory Provides methods for creating, moving and enumerating through directories and sub-directoriesDirectoryInfo Provides instance methods for creating, moving and enumerating directories and sub-directoriesTextReader Represents a reader that can read a sequence of charactersTextWriter Represents a writer that can write a sequence of charactersBinaryReade Reads primitive data types as binary values in a specificr encodingBinaryWriter Writes primitive types in binary to a stream and supportsStreamclasses An abstract class from which different classes are derived MemoryStream used to read and write data to memory BufferedStream used to read and write to the buffer FileStream used to perform read and write operations on files NetworkStream used to send and receive data across the network CryptoStream used to link the stream of data to any cryptography object for the purpose of encrypting the dataFileStreamclassconstructors Constructors DescriptionFileStream(string Takes in the path of the file to beFilePath, FileMode) read from or written to and any one of the FileMode enumerator values as its argumentsFileStream(string Takes in the path of the file to beFilePath, FileMode, read from or written to, any one ofFileAccess) the FileMode enumerator values and FileAccess enumerator values as it argumentsEnumeratorsusedwithFileStreamclass FileMode Enumerators FileAccess Append Enumerators Create Read CreateNew Write Open ReadWrite OpenOrCreate TruncateDirectoryandFileclasses The directory class contains static methods that help in handling directories and subdirectories The file class contains static methods that help in handling files it also helps in the creation of FileStream classFilemethods Methods DescriptionCopy( string Used to copy the contents of a source file to aSourcePath, string destination file in the specified path. If theDestinationPath ); destination file does not exist, a new file is created with the specified name in the specified pathCreate( string Path ) Used to create a file with the specified name in the specified pathDelete( string Path ) Used to delete a file from a specified pathExists( string Path ) Used to verify whether a file with the specified name exists in the specified path. It returns a Boolean valueMove( string Used to move the specified file from theSourcePath, string source location to the destination locationDestinationPath )Directorymethods Methods DescriptionCreateDirectory (String Creates all the directories in the specifiedPath) pathDelete( string Path ) Deletes an empty directory from a specified pathExists( string Path ) Checks whether the given path refers to an existing directory on diskMove( string Used to move the specified file from theSourceFilePath, string source location to the destination locationDestinationFilePath )GetCurrentDirectory() Returns the current working directoryGetDirectories ( string Gets the names of subdirectoriesPath)Ge ...
Tìm kiếm theo từ khóa liên quan:
Lecture Windows programming Lập trình Windows Bài giảng Lập trình Windows Windows programming Streams overview IO namespace and its classesGợi ý tài liệu liên quan:
-
Bài tập lập trình Windows dùng C# - Bài thực hành
13 trang 164 0 0 -
bảo mật mạng các phương thức giả mạo địa chỉ IP fake IP
13 trang 155 0 0 -
Bài giảng Lập trình Windows Form với C#: Chương 3 - Lê Thị Ngọc Hạnh
11 trang 150 0 0 -
information technology outsourcing transactions process strategies and contracts 2nd ed phần 3
65 trang 104 0 0 -
Excel add in development in c and c phần 9
0 trang 102 0 0 -
Giáo trình Lập trình Windows 1 - Trường CĐN Đà Lạt
117 trang 91 0 0 -
Hướng dẫn lập trình OpenGL căn bản
33 trang 50 0 0 -
The CISA Prep Guide Mastering the Certified Information Systems Auditor Exam phần 1
60 trang 43 0 0 -
thủ thuật windows XP hay nhất phần 2
14 trang 39 0 0 -
Bài giảng Lập trình Windows nâng cao: ADO.NET - Bùi Công Danh
57 trang 37 0 0