Windows XP downloading file from ftp using .net 1.0

Joined
Jun 28, 2005
Messages
1
Reaction score
0
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top