public sealed class Client : IDisposable
Public NotInheritable Class Client
Implements IDisposable
Dim instance As Client
public ref class Client sealed : IDisposable
[<SealedAttribute>]
type Client =
class
interface IDisposable
end
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
Private WithEvents uploadClient As New WebClient
Private WithEvents downloadClient As New WebClient
Private ftp As New Client("ftpsite", "username", "password")
Private Sub Test() Handles MyBase.Shown
ftp.Connect()
ftp.CreateDirectory("/DirectoryName", True)
ftp.UploadFile(uploadClient, "C:\File.txt", "/DirectoryName/NewFile.txt", False)
ftp.DownloadFile(downloadClient, "/DirectoryName/NewFile.txt", "c:\DownloadedFile.txt", True)
End Sub
Private Sub Client_UploadProgress(ByVal sender As Object, ByVal e As UploadProgressChangedEventArgs) _
Handles uploadClient.UploadProgressChanged
Label_Upload.Text = e.ProgressPercentage & "%"
End Sub
Private Sub Client_UploadCompleted(ByVal sender As Object, ByVal e As UploadFileCompletedEventArgs) _
Handles uploadClient.UploadFileCompleted
Label_UploadCompleted.Text = e.Result.ToString()
End Sub
Private Sub Client_DownloadProgress(ByVal sender As Object, ByVal e As DownloadProgressChangedEventArgs) _
Handles downloadClient.DownloadProgressChanged
Label_Download.Text = e.ProgressPercentage & "%"
End Sub
Private Sub Client_DownloadCompleted(ByVal sender As Object, ByVal e As AsyncCompletedEventArgs) _
Handles downloadClient.DownloadFileCompleted
Label_DownloadCompleted.Text = "Done!"
End Sub
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
Client | Initializes a new instance of the Client class. |
Connect | Connects to the FTP server. |
CreateDirectory | Creates a directory on the FTP server. |
DeleteDirectory | Creates a directory on the FTP server. |
DeleteFile | Deletes a file on the FTP server. |
DirectoryExists | Checks if a directory exist on the FTP server. |
Disconnect | Disconnects from the FTP server. |
Dispose | Releases all the resources used by this instance. |
DownloadFile | Downloads a file from the FTP server. |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
Execute | Executes a command on the FTP server. |
FileExists | Checks if a file exist on the FTP server. |
GetDirectories | Gets a directory list on the specified path. |
GetFiles | Gets a file list on the specified path. |
GetFileSize | Gets the size of file. |
GetHashAlgorithms | Gets the currently HASH algorithm used for the HASH command on the FTP server. |
GetHashCode | Serves as the default hash function. (Inherited from Object) |
GetLinks | Gets a link list on the specified path. |
GetListing | Gets a file/folder list on the specified path. |
GetModifiedTime | Gets the modified time of file. |
GetNameListing | Returns a file/directory listing using the NLST command. |
GetType | Gets the Type of the current instance. (Inherited from Object) |
GetWorkingDirectory | Gets the current working directory on the FTP server. |
OpenAppend | Opens the specified file to be appended to... |
OpenRead | Opens the specified file for reading. |
OpenWrite | Opens the specified file for writing. |
RenameDirectory | Rename a directory on the FTP server. |
RenameFile | Rename a file on the FTP server. |
SetWorkingDirectory | Sets the working directory on the FTP server. |
ToString | Returns a string that represents the current object. (Inherited from Object) |
TryExecute | Tries to execute a command on the FTP server. |
UploadFile | Uploads a file to the FTP server. |
CanConvertTo |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
CanConvertToT |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions) |
IsDisposable |
Determines whether the specified object is a disposable type
(i.e., it implements IDisposable interface).
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
ThrowIfNullTException |
Throws the specified exception if the source object is null.
(Defined by ObjectExtensions) |