Directory and File Operations

In past versions of Visual Basic, we were relegated to the FileSystemObject (or a similar third-party control) or the Win32 API to implement most file operations. The System.IO namespace provides a robust set of objects for our tool belt. These objects can be leveraged to solve a host of problems and ease and simplify interaction with the file system.

As programmers, it is important for us to understand the key aspects of the Windows file system. A file, in Windows, is an ordered and named collection of a sequence of bytes having persistent storage. When you think of files, you think of a filename, file size, attributes, and directory path. Directories in Windows are simply another type of file that contains other ...

Get Visual Basic® Programmer's Guide to the .NET Framework Class Library now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.