[Délestage] [c#][ftp][Asp.net]WebClient DownLoad File

cyrina84 Messages postés 43 Date d'inscription mardi 3 avril 2007 Statut Membre Dernière intervention 22 mai 2010 - 9 mai 2007 à 09:17
auichance Messages postés 6 Date d'inscription mardi 2 septembre 2008 Statut Membre Dernière intervention 22 octobre 2010 - 22 oct. 2010 à 10:37
private void dowload(string server, string fileName,string login, string pass)
    {
        Uri _LienFormate = new Uri(server + "/" + fileName);
        Response.Write(_LienFormate.Scheme);
        WebClient _ClientWeb = new WebClient();
        if ((login.Length > 0) && (pass > 0))
        {
            _ClientWeb.Credentials = new NetworkCredential(login, pass);
        }
        _ClientWeb.DownloadFile(_LienFormate, "c:/test.xml");
   }

ce code fonctionne tres bien pour une application Windowns, mais lorsque je veux faire le meme truc avec une application web ca renvoi une erreur:
<!-- BEGIN TEMPLATE: bbcode_quote -->

Citation:
URI formats are not supported.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: URI formats are not supported.

<!-- END TEMPLATE: bbcode_quote -->Je ne comprend pas pourquoi...
Merci de votre aide...<!-- / message -->

1 réponse

auichance Messages postés 6 Date d'inscription mardi 2 septembre 2008 Statut Membre Dernière intervention 22 octobre 2010
22 oct. 2010 à 10:37
salut:
 je remercie de tout mon coeur tout ceux qui ont participè dons la realisation de ce site,qui m'a aidè bq afin de trouver des reponces à mes questions curieuses a propos de la programmation
0
Rejoignez-nous