This method downloads data in a byte array from the remote server specified by a host name, path, and port number.
[Visual Basic] Public Function
FtpDownloadFileToByteArray(ByVal remoteHost As String, ByVal
remotePath As String, ByVal remotePort As Integer) As Byte()
[C#] public byte[]
FtpDownloadFileToByteArray(string remoteHost, string remotePath,
int remotePort);
Parameters
remoteHost
DNS style name or IP Address
remotePath
Path on the remote server
remotePort
IP port number
Return Value
Returns True if successful, otherwise returns False
Explanation
The DownloadFileToByteArray method downloads data in a byte array from the remote server specified by a host name, path, and port number.
This method is enabled for FTP protocol.
Example
[Visual Basic.NET]
Dim _ftp As New Newtone.ImageKit.WPF.Ftp
Dim Data As Byte()
'Username and password
_ftp.Credentials = New NetworkCredential("user", "password")
'Passive mode
_ftp.Passive = True
'Downloads the file to byte array
Data = _ftp.DownloadFileToByteArray("www.newtone.co.jp", "test/test.jpg", 21)
[Visual C#.NET]
byte[] Data;
//Username and password
ImageKit.File.FtpCredentials = new NetworkCredential("user", "password");
//Passive mode
ImageKit.File.FtpPassive = true;
//Downloads the file to byte array
Data = ImageKit.File.FtpDownloadFileToByteArray("www.newtone.co.jp", "test/test.jpg", 21);
Dim _ftp As New Newtone.ImageKit.WPF.Ftp
Dim Data As Byte()
'Username and password
_ftp.Credentials = New NetworkCredential("user", "password")
'Passive mode
_ftp.Passive = True
'Downloads the file to byte array
Data = _ftp.DownloadFileToByteArray("www.newtone.co.jp", "test/test.jpg", 21)
[Visual C#.NET]
byte[] Data;
//Username and password
ImageKit.File.FtpCredentials = new NetworkCredential("user", "password");
//Passive mode
ImageKit.File.FtpPassive = true;
//Downloads the file to byte array
Data = ImageKit.File.FtpDownloadFileToByteArray("www.newtone.co.jp", "test/test.jpg", 21);
See Also