NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Directory.GetFileSystemEntriesInDirectory (String, String)

Returns an array of strongly typed FileSystemEntry entries in the path matching the specified search criteria, such as "*.txt".

[Visual Basic]
Overloads Public Shared Function GetFileSystemEntriesInDirectory( _
   ByVal path As String, _
   ByVal searchCriteria As String _
) As FileSystemEntry ()
[C#]
public static FileSystemEntry[] GetFileSystemEntriesInDirectory(
   string path,
   string searchCriteria
);
[C++]
public: static FileSystemEntry* GetFileSystemEntriesInDirectory(
   String* path,
   String* searchCriteria
) [];
[JScript]
public static function GetFileSystemEntriesInDirectory(
   path : String,
   searchCriteria : String
) : FileSystemEntry[];

Parameters

path
The path to be searched.
searchCriteria
The search string.

Return Value

An array of FileSystemEntry objects matching the search criteria.

Exceptions

Exception Type Condition
ArgumentNullException path or searchCriteria is null.
SecurityException The caller does not have the required permission.
ArgumentException The directory name is empty or contains only whitespaces.

Remarks

".." can only be used in searchCriteria if it is specified as a part of a valid file or directory name. It cannot be used to move up the directory hierarchy. For example:

a..b abc..d is valid.

..ab ab.. .. abc..d\abc.. is invalid.

Other wild card characters are allowed in searchCriteria. For example, a search string such as "System*" would match both the System and System32 directories.

Requirements

NGWS Runtime Security:

FileIOPermissionAccess Read flag required for read permission for the path.

See Also

Directory Class | Directory Members | System.IO Namespace | Directory.GetFileSystemEntriesInDirectory Overload List | FileSystemEntry