String urldownload = "http://..."; Byte[] requestXmlConfig = null; try { requestHtml = wc.DownloadData(urldownload); } catch (WebException we) { MessageBox.Show(we.ToString()); return; } System.IO.FileStream fs = new System.IO.FileStream("fichier.xml", System.IO.FileMode.OpenOrCreate); fs.Write(requestHtml, 0, requestHtml.Length); fs.Flush(); fs.Close();
WebClient wc = new WebClient();