Directory.GetFileSystemEntries Method


Directory.GetFileSystemEntries Method

Class

System.IO.Directory

Syntax

     Dim result(  ) As String = Directory.GetFileSystemEntries(path[, _         searchPattern]) 


path (required; String)

A valid path to a directory


searchpattern (optional; String)

A file specification, optionally including the wildcard characters * and ?.

Description

The GetFileSystemEntries method returns a string array with the names of all files and directories in the specified directory, optionally matching a pattern.

Usage at a Glance

  • path can be either an absolute path or a relative path from the current directory.

  • path can be either a path on the local system, the path of a mapped network drive, or a UNC path.

  • path cannot contain wildcard characters, but searchPattern can.

  • If the directory specified by path has no files or subdirectories, or if no files or subdirectories match searchPattern, an empty array is returned.

  • This method combines the functionality of the GetDirectories and GetFiles methods.

Version Differences

Visual Basic 2005 includes a My.Computer.FileSystem object that provides access to detailed information about files and directories.

See Also

Directory.GetDirectories Method, Directory.GetFiles Method




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

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