Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

Download File c#

string folderName = @"C:";
string pathString = System.IO.Path.Combine(folderName, "storefolder");
Directory.CreateDirectory(pathString);
string fileName = System.IO.Path.GetRandomFileName();
pathString = System.IO.Path.Combine(pathString, fileName);

if (!File.Exists(pathString))
{
    WebClient webClient = new WebClient();
    webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted);
    webClient.DownloadFileAsync(new Uri(@"192.168.75.99Developer shared folderIconschemistrywhite.png"), pathString);
}
else
{
    Console.WriteLine("File "{0}" already exists.", fileName);
    return;
}
Source by www.codeproject.com #
 
PREVIOUS NEXT
Tagged: #Download #File
ADD COMMENT
Topic
Name
8+9 =