Dart.Ftp Namespace > Ftp Class > Put Method : Put(List<FileSystemInfo>,String,String,Synchronize) Method |
Public Overloads Function Put( _ ByVal localFileSystemInfos As List(Of FileSystemInfo), _ ByVal localRoot As String, _ ByVal remoteRoot As String, _ ByVal sync As Synchronize _ ) As List(Of CopyResult)
Dim instance As Ftp Dim localFileSystemInfos As List(Of FileSystemInfo) Dim localRoot As String Dim remoteRoot As String Dim sync As Synchronize Dim value As List(Of CopyResult) value = instance.Put(localFileSystemInfos, localRoot, remoteRoot, sync)
localFileSystemInfos must contain DirectoryInfo objects for any subfolders under localRoot containing files specified by FileInfo objects in this list, if the subfolder does not exist in remoteRoot.
DataIsBusy returns true while this method executes.
The local file and directory paths relative to localRoot are assumed to be legal on the remote filesystem. If not, use the other Put methods to specify a legal remote path manually.
public void putMultipleFiles() { //Get a list of files to put. System.IO.DirectoryInfo rootDir = new System.IO.DirectoryInfo(myLocalDirectory); List<System.IO.FileSystemInfo> files = new List<System.IO.FileSystemInfo>(rootDir.GetFileSystemInfos()); //Modify the list prior to the Put. files.Remove(new System.IO.FileInfo(myLocalDirectory + "\\not_me.txt")); //Put the files. ftp1.Put(files, myLocalDirectory, "MyTextFiles", Synchronize.Off); }
Public Sub putMultipleFiles() 'Get a list of files to put. Dim rootDir As New System.IO.DirectoryInfo(myLocalDirectory) Dim files As New List(Of System.IO.FileSystemInfo)(rootDir.GetFileSystemInfos()) 'Modify the list prior to the Put. files.Remove(New System.IO.FileInfo(myLocalDirectory & "\not_me.txt")) 'Put the files. ftp1.Put(files, myLocalDirectory, "MyTextFiles", Synchronize.Off) End Sub