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:
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. |
Je ne comprend pas pourquoi...
Merci de votre aide...