File System Sample

This sample demonstrates methods of the My.Computer.FileSystem Object.

Security Note

This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential damages should the sample code be used for purposes other than as intended.

To run this sample

  1. Click the Download Sample button on this page. In the File Download dialog, select Open.

  2. Save the files to your computer.

  3. In Visual Studio, select the File menu, then Open, then Project/Solution.

  4. Browse to the folder where you saved the files and select the solution file. This opens the solution in Visual Studio.

  5. On the Build menu, select BuildFileSystemSample.

  6. Press F5.

To view the sample documentation

  1. In Solution Explorer, double-click the Documentation folder.

  2. If you are using Visual Basic Express Edition, right-click ReadMe.htm in the Documentation folder. Select View in Browser.

  3. If you are using another version of Visual Basic, double-click ReadMe.htm in the Documentation folder.

Demonstrates

This sample provides an interface for running the file-system methods of the My.Computer.FileSystem Object. A TreeView control on one side lets you pick the type of methods you want to run. When a method is selected, a custom control appears on the form that allows you to input parameters for the method and then execute the method. Thus the project contains a separate user control for each method demonstrated.