comment utiliser DownloadStringAsync avec Savefiledialog
voila mon code c pour télécharger un fichier (se trouve sur le server) ver ma machine client:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| private void charger_cv_Click(object sender, RoutedEventArgs e)
{
SaveFileDialog dialog = new SaveFileDialog();
dialog.Filter = "All Files|*.*";
bool? dialogResult = dialog.ShowDialog();
if (dialogResult != true) return;
WebClient webClient = new WebClient();
WebClient we = new WebClient();
we.DownloadStringAsync(new Uri(textBox_lienCV.Text), UriKind.RelativeOrAbsolute);
we.DownloadStringCompleted += (s, ee) =>
{
try
{
using (Stream fs = (Stream)dialog.OpenFile())
{
ici on fais quoi ????????????????????????????8O8O8O
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
};
} |