hi i am using the following code but it giving an error
using (WebClient ftpClient = new WebClient())
{
ftpClient.Credentials = new System.Net.NetworkCredential("username", "password");
ftpClient.DownloadFile("ftp://path.com/Business Plan.docx", "D:\\Folder\test.docx");
}
but i am getting an error illegal characters in path.
I am not understanding how to do that.
This string:
"D:\\Folder\test.docx"
Is treating the slashes ('\
') as escape characters - use this instead:
@"D:\Folder\test.docx"
Or (more messy), double escape to be treated as a literal slash:
"D:\\Folder\\test.docx"