TAILIEUCHUNG - ASP.NET 4 Unleased - p 117

1134 CHAPTER 24 Advanced Navigation Typically, you override the FileExists() and GetFile() methods to retrieve a file from your data store. If you want to represent directories, you also need to override the DirectoryExists() and GetDirectory() methods. Several of these methods are related to caching. The VirtualPathProvider needs to know when a file has been modified so that it can retrieve the new version of the file and compile it. By default, the Framework uses a file dependency to determine when a file has been modified on the hard drive. However, in this situation a SqlCacheDependency is used because the files will. | 1134 CHAPTER 24 Advanced Navigation Typically you override the FileExists and GetFile methods to retrieve a file from your data store. If you want to represent directories you also need to override the DirectoryExists and GetDirectory methods. Several of these methods are related to caching. The VirtualPathProvider needs to know when a file has been modified so that it can retrieve the new version of the file and compile it. By default the Framework uses a file dependency to determine when a file has been modified on the hard drive. However in this situation a SqlCacheDependency is used because the files will be stored in a database. The VirtualPathProvider also includes a useful property Previous Returns the previously registered VirtualPathProvider. The Previous property enables you to use the default VirtualPathProvider. For example if you want to store some files in the file system and other files in the database you can use the Previous property to avoid rewriting all the logic for working with files in the file system. The GetFile method returns an instance of the VirtualFile class. When using the VirtualPathProvider you must create a new class that inherits from the VirtualFile class. This class contains the following properties IsDirectory Always returns False. Name Returns the name of the file. VirtualPath Returns the virtual path of the file. The VirtualFile class also contains the following method Open Returns the contents of the file. Typically when creating a class that inherits from the VirtualFile class you override the Open method. For example we override this method to get the contents of a file from a database table in the code sample built in this section. The GetDirectory method returns an instance of the VirtualDirectory class. This class contains the following properties Children Returns all the files and directories that are children of the current directory. Directories Returns all the directories that are children of the current .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.