1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
public void dl()//string lien)
{
string remoteUri = "http://sdlc-esd.sun.com/ESD6/JSCDL/jdk/7u60-b19/";
string fileName = "jre-7u60-windows-x64.exe";
string myStringWebResource = null;
// Creation d'une nouvelle instance WebClient.
WebClient myWebClient = new WebClient();
// Concatenate the domain with the Web resource filename.
myStringWebResource = remoteUri + fileName;
try
{
// Download the Web resource and save it into the current filesystem folder.
myWebClient.DownloadFile(myStringWebResource,fileName);
Console.WriteLine("success");
}
catch(Exception e)
{
Console.WriteLine("erreur de dl : "+e);
}
} |
Partager