DirectoryInfoGetFileSystemInfos Method |
Returns an array of strongly typed
FileSystemInfo entries representing
all the files and subdirectories in a directory.
Namespace: Crestron.SimplSharp.CrestronIOAssembly: SimplSharpHelperInterface (in SimplSharpHelperInterface.dll) Version: 2.21.121
Syntax
Exceptions
Example
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO;;
public class FileSystemInfos
{
public static void Main()
{
try
{
// Create a reference to a directory.
DirectoryInfo dir = new DirectoryInfo("MyDirectory");
if (dir.Exists)
{
// Call the GetFileSystemInfos method.
FileSystemInfo[] infos = dir.GetFileSystemInfos();
//Display the results to the console.
CrestronConsole.Print("SubDirectories and files \r\n");
foreach( FileSystemInfo f in infos)
{
CrestronConsole.Print(" " + f.FullName + "\r\n");
}
}
}
catch (Exception Ex)
{
CrestronConsole.Print(String.Format("Unable to access directory '{0}'", _diretoryInfo.FullName));
}
return
}
Version Information
.NET
Supported in: 6.0
.NET Compact Framework
Supported in: 3.5
See Also