We will use WebClient class
and its method DownloadFile
.This method has two parameters,first parameter is the url of the file we want to download and the second parameter is path to local disk to which we want to save the file.
This method blocks the main thread until the file is downloaded or an error occur in this case the WebException is thrown.
WebClient webClient = new WebClient();