Chapter 29: File-System Objects


Visual Basic includes a bewildering assortment of objects that you can use to manipulate drives, directories, and files. The stream classes described in Chapter 28 enable you to read and write files, but they don’t really capture any of the special structure of the file system.

A Visual Basic application has two main choices for working with the file system: Visual Basic methods and .NET Framework classes. This chapter describes these two approaches and the classes that they use. It finishes by describing some of the My namespace properties and methods that you can use to access file-system tools more easily. For more information on the My namespace, see the section “My” in Chapter 27 and Appendix R.

Permissions

An application cannot perform a task if the user running it doesn’t have the appropriate permissions. Although this is true of any operation a program must perform, permission issues are particularly common when working with files, and the Windows Vista operating system is particularly strict about enforcing permission requirements.

A common mistake is for developers to build an application while logged in as a user who has a lot of privileges. Sometimes, developers even have system administrator privileges, so their programs can do pretty much anything on the computer. To ensure that users will have the permissions needed by an application, develop or at least test the code using an account with the privileges that typical users will have.

Chapter 14 describes permissions in greater detail.




Visual Basic 2005 with  .NET 3.0 Programmer's Reference
Visual Basic 2005 with .NET 3.0 Programmer's Reference
ISBN: 470137053
EAN: N/A
Year: 2007
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net