Using C# 4.5,I'm trying to programmatically log-on to a third-party website and then download a csv file from another page on that site. I tried using following approach.I dont get any errors but it seems to download the contents of their logon page and save it as a csv file instead of the actual csv file having data.
Also,if I read the response stream after logging in, I see that I'm getting the log-on webpage back.
What am I missing here please? Plus, I need to post the name of the form as well.How do I achieve that?Please advise.
Update:I tried using CookieContainer in request object, but still no luck..I get the same result.
Thanks.
//Log-on to website and post user and password