Dart.Ftp Namespace : StoreType Enumeration |
Public Enum StoreType Inherits System.Enum
Dim instance As StoreType
public enum StoreType : System.Enum
public enum class StoreType : public System.Enum
Member | Description |
---|---|
Append | If an existing file is present, append the stored file to it. |
Replace | Over-write any existing file. |
Unique | If an existing file is present, store the file using a unique name. |
This enumeration is used by the Ftp.Put methods, specifying the action to take when a file is put to the server and there is an existing file with the same name. Use StoreType.Replace to overwrite the existing file, StoreType.Append to add the new file to the end of the existing file, and StoreType.Unique to store the file with a unique name. The unique name will be returned in the response.
/// <summary> /// Appends the specified local file to the remote file /// </summary> /// <param name="myFtp">A connected and authenticated Ftp instance</param> /// <param name="localPath">Path to the local file</param> /// <param name="remotePath">An absolute or relative path to the file on the server</param> /// <returns>The CopyResult of the operation</returns> public CopyResult AppendFile(Ftp myFtp, string localPath, string remotePath) { //Open the local file using (FileStream fs = File.OpenRead(localPath)) { //Append the local file to the destination, and (optionally) return the result return myFtp.Put(fs, remotePath, 0, StoreType.Append); } }
''' <summary> ''' Appends the specified local file to the remote file ''' </summary> ''' <param name="myFtp">A connected and authenticated Ftp instance</param> ''' <param name="localPath">Path to the local file</param> ''' <param name="remotePath">An absolute or relative path to the file on the server</param> ''' <returns>The CopyResult of the operation</returns> Public Function AppendFile(ByVal myFtp As Ftp, ByVal localPath As String, ByVal remotePath As String) As CopyResult 'Open the local file Using fs As FileStream = File.OpenRead(localPath) 'Append the local file to the destination, and (optionally) return the result Return myFtp.Put(fs, remotePath, 0, StoreType.Append) End Using End Function
System.Object
System.ValueType
System.Enum
Dart.Ftp.StoreType