Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 5. Files and Directories

Chapter 5. Files and Directories

Previous versions of Microsoft Visual Basic have always been underweight when it came to file management. Most Visual Basic 6.0 programmers used legacy functions such as Open and Input that were built into the language and identified files using numbers. More adventurous developers could use the File Scripting Objects (FSO) model, which provided an object-oriented way to manipulate files, but lacked important features such as the ability to read and write binary files. In Microsoft .NET, the story is completely different—for the first time, Visual Basic developers have a rich set of objects that allow them to retrieve file system information, move and rename files and directories, create text and binary files, and even monitor a specific path for changes.

The first batch of recipes in this chapter describes the basics for manipulating files and directories. Later recipes include advanced techniques, such as selecting files with wildcards (recipe 5.6), performing recursive searches (recipes 5.7 and 5.8), reading just-in-time file information (recipe 5.9), and using isolated stores to allow file creation in low-security contexts (recipe 5.15). You’ll even learn the starting points for dealing with some more specialized formats, including MP3 files (recipe 5.18) and ZIP files (recipe 5.19).


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial