i m working on web application in which i want to download a wav file on client machine from ftp.
private static void DemonstrateWebClient( string serverName, NetworkCredential credentials)
{
string serverAddress = "ftp://" + serverName + "/";
// Create a new WebClient object and set the credentials.
WebClient webClient = new WebClient();
webClient.Credentials = credentials;
// Download file.
try
{
string downloadAddress = serverAddress + fileName;
webClient.DownloadFile(downloadAddress, fileName);
}
catch (WebException ex)
{
Response.Write(ex.Message);
}
}
i get webexception for this.
what should i do.thanx in advance.
private static void DemonstrateWebClient( string serverName, NetworkCredential credentials)
{
string serverAddress = "ftp://" + serverName + "/";
// Create a new WebClient object and set the credentials.
WebClient webClient = new WebClient();
webClient.Credentials = credentials;
// Download file.
try
{
string downloadAddress = serverAddress + fileName;
webClient.DownloadFile(downloadAddress, fileName);
}
catch (WebException ex)
{
Response.Write(ex.Message);
}
}
i get webexception for this.
what should i do.thanx in advance.