My program does exactly what you are after, no prompts or anything, please see the following code.
This code will create all of the necessary directories if they don't already exist:
Directory.CreateDirectory(C:dirdiradirb); // This code will create all of these directories
This code will download the given file to the given directory (after it has been created by the previous snippet:
private void install()
{
WebClient webClient = new WebClient(); // Creates a webclient
webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed); // Uses the Event Handler to check whether the download is complete
webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged); // Uses the Event Handler to check for progress made
webClient.DownloadFileAsync(new Uri("http://www.com/newfile.zip"), @"C
ewfile.zip"); // Defines the URL and destination directory for the downloaded file
}
So using these two pieces of code you can create all of the directories and then tell the downloader (that doesn't prompt you to download the file to that location.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…