This method downloads a file to byte array from the remote server specified by the URI
[Visual Basic] Public Function
HttpDownloadFileToByteArray(ByVal remoteAddress As String) As
Byte()
[C#] public byte[]
HttpDownloadFileToByteArray(string 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("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("http://www.newtone.co.jp/test/test.jpg");
Dim Data As Byte()
'Username and password
ImageKit1.File.HttpCredentials = New NetworkCredential("user", "password")
'Downloads 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");
//Downloads file
Data = ImageKit1.File.HttpDownloadFileToByteArray("http://www.newtone.co.jp/test/test.jpg");
See Also
ImageKit.File Members | Newtone.ImageKit.Wpf.ImageKit