To download a resource and continue executing while waiting for the server's response, use one of the DownloadFileAsync methods. This method blocks while downloading the resource. The DownloadFile method downloads to a local file data from the URI specified by in the address parameter. MyStringWebResource = String::Concat( remoteUri, fileName ) Ĭonsole::WriteLine( "Downloading File \"""", fileName, myStringWebResource)Ĭonsole.WriteLine((ControlChars.Cr "Downloaded file saved in the following file system folder:" ControlChars.Cr ControlChars.Tab Application.StartupPath)) Concatenate the domain with the Web resource filename. WebClient^ myWebClient = gcnew WebClient String^ fileName = "ms-banner.gif", ^myStringWebResource = nullptr The following code example downloads a file from to the local hard drive. The method has been called simultaneously on multiple threads.
0 Comments
Leave a Reply. |