DirList Event
Fired when a directory entry is received.
Syntax
public event OnDirListHandler OnDirList; public delegate void OnDirListHandler(object sender, SftpDirListEventArgs e); public class SftpDirListEventArgs : EventArgs { public string DirEntry { get; } public string FileName { get; } public bool IsDir { get; } public long FileSize { get; } public string FileTime { get; } public bool IsSymlink { get; } }
Public Event OnDirList As OnDirListHandler Public Delegate Sub OnDirListHandler(sender As Object, e As SftpDirListEventArgs) Public Class SftpDirListEventArgs Inherits EventArgs Public ReadOnly Property DirEntry As String Public ReadOnly Property FileName As String Public ReadOnly Property IsDir As Boolean Public ReadOnly Property FileSize As Long Public ReadOnly Property FileTime As String Public ReadOnly Property IsSymlink As Boolean End Class
Remarks
The DirList events are fired when a directory listing is received as a response to a ListDirectory.
The StartTransfer and EndTransfer events mark the beginning and end of the event stream.
The DirEntry parameter contains the filename when ListDirectory is called.
The component tries to fill out the FileName, IsDir, FileSize, and FileTime parameters when calling the ListDirectory method.
The format of the FileTime parameter returned by the component can be controlled through the FileTimeFormat configuration setting. If no format is specified, the component will format the date dependent on the year. If the filetime is in the same year, it will be formatted as "MMM dd HH:mm", otherwise it will be formatted as "MMM dd yyyy".
IsSymlink indicates whether the entry is a symbolic link. When the entry is a symbolic link the value of IsDir will always be False since this information is not returned in the directory listing. To inspect a symlink to determine if it is a link to a file or folder set RemoteFile and query the IsDir field.