FileSystem Class
.NET Framework 3.0
The FileSystem module contains the procedures that are used to perform file, directory or folder, and system operations. The My feature gives you better productivity and performance in file I/O operations than using the FileSystem module. For more information, see My.Computer.FileSystem Object.
Namespace: Microsoft.VisualBasic
Assembly: Microsoft.VisualBasic (in microsoft.visualbasic.dll)
Assembly: Microsoft.VisualBasic (in microsoft.visualbasic.dll)
For more detailed information, see the Visual Basic topic FileSystem Module (Visual Basic).
This module supports the Visual Basic language keywords and run-time library members that access files and folders.
This example uses the GetAttr function to determine the attributes of a file and directory or folder.
Dim MyAttr As FileAttribute ' Assume file TESTFILE is normal and readonly. MyAttr = GetAttr("C:\TESTFILE.txt") ' Returns vbNormal. ' Test for normal. If (MyAttr And FileAttribute.Normal) = FileAttribute.Normal Then MsgBox("This file is normal.") End If ' Test for normal and readonly. Dim normalReadonly As FileAttribute normalReadonly = FileAttribute.Normal Or FileAttribute.ReadOnly If (MyAttr And normalReadonly) = normalReadonly Then MsgBox("This file is normal and readonly.") End If ' Assume MYDIR is a directory or folder. MyAttr = GetAttr("C:\MYDIR") If (MyAttr And FileAttribute.Directory) = FileAttribute.Directory Then MsgBox("MYDIR is a directory") End If
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: