Chapter 13 - File IO and Isolated Storage
Số trang: 69
Loại file: ppt
Dung lượng: 2.66 MB
Lượt xem: 19
Lượt tải: 0
Xem trước 7 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
“The System.IO namespace allows you to interact with a machine’s fileand directory structure. Over the course of this chapter, you willlearn how to programmatically create (and destroy) a directorysystem as well as move data into and out of various streams (filebased, string based, memory based, etc.). The latter part of thischapter examines the role of isolated storage, which allows you topersist per-user data into a safe sandbox, regardless of the securitysettings of a target machine. To understand certain aspects of theSystem.IO.IsolatedStorage API, you will also receive an overview ofCode Access Security (CAS).…”...
Nội dung trích xuất từ tài liệu:
Chapter 13 - File IO and Isolated StorageChapter 13. File I/O and Isolated Storage Hoang Anh Viet VietHA@it-hut.edu.vn Hanoi University of Technology 1 Objectives “The System.IO namespace allows you to interact with a machine’s file and directory structure. Over the course of this chapter, you will learn how to programmatically create (and destroy) a directory system as well as move data into and out of various streams (file based, string based, memory based, etc.). The latter part of this chapter examines the role of isolated storage, which allows you to persist per-user data into a safe sandbox, regardless of the security settings of a target machine. To understand certain aspects of the System.IO.IsolatedStorage API, you will also receive an overview of Code Access Security (CAS).…”Microsoft 2 Roadmap 1. Exploring the System.IO namespace 2. Working with File System 3. The Abstract System Class 4. Working with StreamWriters and StreamReaders 5. Working with StringWriters and StringReaders 6. Working with BinaryWriters and BinaryReaders 7. Programmatically “Watching” Files 8. Performing Asynchronous File I/O 9. An Overview of Isolated Storage 10. Introducing Object SerializationMicrosoft 3 13.1 Exploring the System.IO namespace System.IO namespace is the region of the base class libraries devoted to file-based (and memory-based) input and output (I/O) services System.IO defines a set of classes, interfaces, enumerations, structures, and delegates, most of which are contained in mscorlib.dllMicrosoft 4 Figure 13.1 Key Members of the System.IO Namespace Nonabstract I/O Class Description Type BinaryReader, BinaryWriter These types allow you to store and retrieve primitive data types (integers, Booleans, strings, and whatnot) as a binary value. BufferedStream This type provides temporary storage for a stream of bytes that may be committed to storage at a later time Directory, DirectoryInfo These types are used to manipulate a machine’s directory structure. The Directory type exposes functionality using static members. The DirectoryInfo type exposes similar functionality from a valid object reference. DriveInfo This type provides detailed information regarding the drives used by a given machine. File, FileInfo These types are used to manipulate a machine’s set of files. The File type exposes functionality using static members. The FileInfo type exposes similar functionality from a valid object reference. FileStream This type allows for random file access (e.g., seeking capabilities)with data represented as a stream of bytes.Microsoft 5 Figure 13.1 Key Members of the System.IO Namespace (Cont.) Nonabstract I/O Class Description Type FileSystemWatcher This type allows you to monitor the modification of external files in a specified directory. MemoryStream This type provides random access to streamed data stored in memory rather than a physical file. Path This type performs operations on System.String types that contain file or directory path information in a platform-neutral manner. StreamWriter, StreamReader These types are used to store (and retrieve) textual information to (or from) a file. These types do not support random file access. StringWriter, StringReader Like the StreamReader/StreamWriter types, these classes also work with textual information. However, the underlying storage is a string buffer rather than a physical file.Microsoft 6 Roadmap 1. Exploring the System.IO namespace 2. Working with File System 3. The Abstract System Class 4. Working with StreamWriters and StreamReaders 5. Working with StringWriters and StringReaders 6. Working with BinaryWriters and BinaryReaders 7. Programmatically “Watching” Files 8. Performing Asynchronous File I/O 9. An Overview of Isolated Storage 10. Introducing Object SerializationMicrosoft 7 13.2 Working with File System System.IO namespace include a few basic classes for retrieving file system information Directory and File: These classes provide static methods that allow you to retrieve information about any files and directories that are visible from your server DriveInfo, DirectoryInfo, FileInfo: These classes use similar instance methods and properties to retrieve the same information ... The simplest level of file access: Involves retrieving information about existing files and directories Performing typical file system operations such as copying files and creating directoriesMicrosoft ...
Nội dung trích xuất từ tài liệu:
Chapter 13 - File IO and Isolated StorageChapter 13. File I/O and Isolated Storage Hoang Anh Viet VietHA@it-hut.edu.vn Hanoi University of Technology 1 Objectives “The System.IO namespace allows you to interact with a machine’s file and directory structure. Over the course of this chapter, you will learn how to programmatically create (and destroy) a directory system as well as move data into and out of various streams (file based, string based, memory based, etc.). The latter part of this chapter examines the role of isolated storage, which allows you to persist per-user data into a safe sandbox, regardless of the security settings of a target machine. To understand certain aspects of the System.IO.IsolatedStorage API, you will also receive an overview of Code Access Security (CAS).…”Microsoft 2 Roadmap 1. Exploring the System.IO namespace 2. Working with File System 3. The Abstract System Class 4. Working with StreamWriters and StreamReaders 5. Working with StringWriters and StringReaders 6. Working with BinaryWriters and BinaryReaders 7. Programmatically “Watching” Files 8. Performing Asynchronous File I/O 9. An Overview of Isolated Storage 10. Introducing Object SerializationMicrosoft 3 13.1 Exploring the System.IO namespace System.IO namespace is the region of the base class libraries devoted to file-based (and memory-based) input and output (I/O) services System.IO defines a set of classes, interfaces, enumerations, structures, and delegates, most of which are contained in mscorlib.dllMicrosoft 4 Figure 13.1 Key Members of the System.IO Namespace Nonabstract I/O Class Description Type BinaryReader, BinaryWriter These types allow you to store and retrieve primitive data types (integers, Booleans, strings, and whatnot) as a binary value. BufferedStream This type provides temporary storage for a stream of bytes that may be committed to storage at a later time Directory, DirectoryInfo These types are used to manipulate a machine’s directory structure. The Directory type exposes functionality using static members. The DirectoryInfo type exposes similar functionality from a valid object reference. DriveInfo This type provides detailed information regarding the drives used by a given machine. File, FileInfo These types are used to manipulate a machine’s set of files. The File type exposes functionality using static members. The FileInfo type exposes similar functionality from a valid object reference. FileStream This type allows for random file access (e.g., seeking capabilities)with data represented as a stream of bytes.Microsoft 5 Figure 13.1 Key Members of the System.IO Namespace (Cont.) Nonabstract I/O Class Description Type FileSystemWatcher This type allows you to monitor the modification of external files in a specified directory. MemoryStream This type provides random access to streamed data stored in memory rather than a physical file. Path This type performs operations on System.String types that contain file or directory path information in a platform-neutral manner. StreamWriter, StreamReader These types are used to store (and retrieve) textual information to (or from) a file. These types do not support random file access. StringWriter, StringReader Like the StreamReader/StreamWriter types, these classes also work with textual information. However, the underlying storage is a string buffer rather than a physical file.Microsoft 6 Roadmap 1. Exploring the System.IO namespace 2. Working with File System 3. The Abstract System Class 4. Working with StreamWriters and StreamReaders 5. Working with StringWriters and StringReaders 6. Working with BinaryWriters and BinaryReaders 7. Programmatically “Watching” Files 8. Performing Asynchronous File I/O 9. An Overview of Isolated Storage 10. Introducing Object SerializationMicrosoft 7 13.2 Working with File System System.IO namespace include a few basic classes for retrieving file system information Directory and File: These classes provide static methods that allow you to retrieve information about any files and directories that are visible from your server DriveInfo, DirectoryInfo, FileInfo: These classes use similar instance methods and properties to retrieve the same information ... The simplest level of file access: Involves retrieving information about existing files and directories Performing typical file system operations such as copying files and creating directoriesMicrosoft ...
Tìm kiếm theo từ khóa liên quan:
C sharp database lập trình với C ngôn ngữ lập trình C tài liệu về lập trìnhGợi ý tài liệu liên quan:
-
101 trang 200 1 0
-
Hướng dẫn lập trình với Android part 4
5 trang 156 0 0 -
Tìm hiểu về ngôn ngữ lập trình C: Phần 1 - Quách Tuấn Ngọc
211 trang 149 0 0 -
161 trang 130 1 0
-
Giáo trình Vi điều khiển PIC: Phần 1
119 trang 116 0 0 -
Bài giảng Phương pháp lập trình: Chương 9 - GV. Từ Thị Xuân Hiền
36 trang 112 0 0 -
Trắc nghiệm 300 câu phân tích và thiết kế hệ thống
29 trang 100 0 0 -
Đồ án vi xử lý đề tài : nghiên cứu thiết kế mạch đo khoảng cách sử dụng vi điều khiển Pic 16F887
45 trang 97 1 0 -
Tìm hiểu về ngôn ngữ lập trình C: Phần 2 - Quách Tuấn Ngọc
210 trang 89 0 0 -
863 trang 83 0 0