指定した URI を持つリモートサーバからバイト配列にデータをダウンロードします。
[Visual Basic]
Public Function FtpDownloadFileToByteArray(ByVal remoteAddress As System.Uri) As Byte()
[C#]
public byte[] FtpDownloadFileToByteArray(System.Uri remoteAddress);

パラメータ

remoteAddress
ダウンロード元の URI

戻り値

成功の場合はデータを格納したバイト配列を、失敗の場合は null (Visual Basic では Nothing)を返します。

解説

FTP プロトコルの場合に有効です。

使用例

[Visual Basic.NET]
Dim Data As Byte()
'ユーザ名とパスワード
ImageKit.File.FtpCredentials = New NetworkCredential("user", "password")
'パッシブモード接続
ImageKit.File.FtpPassive = True
'ファイルのダウンロード
Data = ImageKit.File.FtpDownloadFileToByteArray(New Uri("ftp://www.newtone.co.jp/test/test.jpg"))

[Visual C#.NET]
byte[] Data;
//ユーザ名とパスワード
ImageKit.File.FtpCredentials = new NetworkCredential("user", "password");
//パッシブモード接続
ImageKit.File.FtpPassive = true;
//ファイルのダウンロード
Data = ImageKit.File.FtpDownloadFileToByteArray(new Uri("ftp://www.newtone.co.jp/test/test.jpg"));

参照

ImageKit.File メンバ | Newtone.ImageKit.WPF.ImageKit