I wrote this code to download a file from an FTP server. When the program tries to download and save the file, I get an access denied error. I tried opening the program with admin rights, but it gives the same error.
WebClient request = new WebClient();
request.Credentials = new NetworkCredential(txtFTPuser.Text,
txtFTPpassword.Text);
/*List all directory files*/
byte[] fileData = request.DownloadData(fullDownloaPath);//dnoces.dreamhost.com
FileStream fi = File.Create(downloadTo);
fi.Write(fileData, 0, fileData.Length);
fi.Close();
MessageBox.Show("Completed!");