Dart.Ftp Namespace > Ftp Class : List Method |
Public Function List( _ ByVal remoteRoot As String, _ ByVal pattern As String, _ ByVal type As ListType _ ) As Listing
Exception | Description |
---|---|
System.ArgumentException | pattern is an absolute path (starts with "/"). |
The pattern can include arguments, such as "-r" for recursive or "-a" to include hidden files. If remoteRoot is specified (not null or an empty string), and pattern is intended to only contain arguments, you must prepend a wildcard to pattern, e.g. "* -a".
If your server returns the timestamp in a non-standard format, or uses non-english month abbreviations, set Ftp.Session.DateTimeFormatInfo to the CultureInfo.DateTimeFormat of the appropriate CultureInfo.
DataIsBusy returns true while this method executes.
private void getListing() { //Connect and log into the server, and get a listing ftp1.Connect(myServer); ftp1.Authenticate(myUsername, myPassword); Listing listing = ftp1.List("", "", ListType.Full); //Add all the list entries in the listing to a listbox foreach (ListEntry entry in listing) listBox1.Items.Add(entry.Text); //Logout of the server ftp1.Close(); }
Private Sub getListing() 'Connect and log into the server, and get a listing ftp1.Connect(myServer) ftp1.Authenticate(myUsername, myPassword) Dim listing As Listing = ftp1.List("", "", ListType.Full) 'Add all the list entries in the listing to a listbox For Each entry As ListEntry In listing listBox1.Items.Add(entry.Text) Next entry 'Logout of the server ftp1.Close() End Sub