This method downloads a file to byte array from the remote server specified by a scheme, host name, and path.

[Visual Basic] Public Function HttpDownloadFileToByteArray(ByVal scheme As String, ByVal remoteHost As String, ByVal remotePath As String) As Byte()
[C#] public byte[] HttpDownloadFileToByteArray(string scheme, string remoteHost, string remotePath);

Parameters

scheme

Internet Access Protocol ("http" or "https")

remoteHost

DNS style domain name or IP address

remotePath

Remote server name

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 a scheme, host name, and path.

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")
'Download file
Data = ImageKit1.File.HttpDownloadFileToByteArray("http", "www.newtone.co.jp", "test/test.jpg")

[Visual C#.NET]

byte[] Data;
//Username and password
ImageKit1.File.HttpCredentials = new NetworkCredential("user", "password");
//Download file
Data = ImageKit1.File.HttpDownloadFileToByteArray("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