This method downloads a file to byte array from the remote server specified by the URI

[Visual Basic] Public Function HttpDownloadFileToByteArray(ByVal remoteAddress As System.Uri) As Byte()
[C#] public byte[] HttpDownloadFileToByteArray(System.Uri remoteAddress);

Parameters

remoteAddress

The URI to the download file on the remote server

Return Value

Returns data in a byte array if successful, otherwise returns null (Nothing in Visual Basic)

Explanation

The HttpDownloadFileToByteArray method downloads a file to byte array from the remote server specified by the URI.

This method is enabled for HTTP or HTTPS protocol.

Example

[Visual Basic.NET]

Dim Data As Byte()
'Username and password
ImageKit1.File.HttpCredentials = New NetworkCredential("user", "password")
'Downloads file
Data = ImageKit1.File.HttpDownloadFileToByteArray(New Uri("http://www.newtone.co.jp/test/test.jpg"))

[Visual C#.NET]

byte[] Data;
//Username and password
ImageKit1.File.HttpCredentials = new NetworkCredential("user", "password");
//Downloads file
Data = ImageKit1.File.HttpDownloadFileToByteArray(new Uri("http://www.newtone.co.jp/test/test.jpg"));

See Also

ImageKit.File Members | Newtone.ImageKit.Wpf.ImageKit

 

The ImageKit WPF is created by Newtone Corporation