Posted on: 10/19/2013 4:40:20 AM | Views : 542

Hello,
I have to download a file automatically from password protected website,we do it manually & I've to automate this process.It has a simple code as I did
WebClient client = new WebClient(); client.Credentials = new NetworkCredential("username", "password");
client.DownloadFile("https://e.brightree.net/Home/frmMyReportOpen.aspx?FileName=dfbf0f94-767e-4c71-b4ee-2dc05fb76e3c.csv&FileExtension=CSV&FilePath=XFwxOTIuMTY4LjkuOTVcQlRSZXBvcnRzXA==", @"D:\Uroosa\16thOct.csv");

bt unfortunately Its downloading the HTML code of that page(frmMyReportOpen.aspx) instead of file.Any help

Go to the complete details ...