This method downloads data on the Http server with specified URI to a local file.

[Visual Basic] Public Function DownloadFile(ByVal remoteAddress As System.Uri, ByVal localFileName As String) As Boolean
[C#] public bool DownloadFile(System.Uri remoteAddress, string localFileName);

Parameters

remoteAddress
The URI of the file on the server to be downloaded
localFileName
Local file name

Return Value

Returns True if successful. Returns False if unsuccessful.

Explanation

The DownloadFile method downloads data on the Http server with specified URI to a local file.

This method is effective for the HTTP or HTTPS protocol.

Example

[Visual Basic.NET]
Dim _http As New Newtone.ImageKit.Http
Dim Ret As Boolean
'Username and password
_http.Credentials = New NetworkCredential("user", "password")
'Downloads the file
Ret = _http.DownloadFile(New Uri("http://www.newtone.co.jp/test/test.jpg"), "c:\test\test.jpg")

[Visual C#.NET]
Newtone.ImageKit.Http _http = new Newtone.ImageKit.Http();
bool Ret;
//Username and password
_http.Credentials = new NetworkCredential("user", "password");
//Downloads the file
Ret = _http.DownloadFile(new Uri("http://www.newtone.co.jp/test/test.jpg"), @"c:\test\test.jpg");

See Also

Http Class | Http Members


The ImageKit.NET X is created by Newtone Corporation