[Visual Basic] Public Function HttpDownloadFileToByteArray(ByVal remoteAddress As System.Uri) As Byte()
[C#] public byte[] HttpDownloadFileToByteArray(System.Uri remoteAddress);
パラメータ
- remoteAddress
- ダウンロード元の URI
戻り値
成功の場合はデータを格納したバイト配列を、失敗の場合は null (Visual Basic では Nothing)を返します。
解説
HTTP , HTTPS プロトコルの場合に有効です。
使用例
[Visual Basic.NET] Dim Data As Byte() 'ユーザ名とパスワード ImageKit1.File.HttpCredentials = New NetworkCredential("user", "password") 'ファイルのダウンロード Data = ImageKit1.File.HttpDownloadFileToByteArray(New Uri("http://www.newtone.co.jp/test/test.jpg")) [Visual C#.NET] byte[] Data; //ユーザ名とパスワード ImageKit1.File.HttpCredentials = new NetworkCredential("user", "password"); //ファイルのダウンロード Data = ImageKit1.File.HttpDownloadFileToByteArray(new Uri("http://www.newtone.co.jp/test/test.jpg"));
参照
ImageKit.File メンバ | Newtone.ImageKit.WPF.ImageKit