Tuesday, April 23, 2013

Cookie Aware Web Client on .NET Framework 3.5

Have been working on a project where I needed to download some files from a website which uses forms authentication.

I created a console application using VS 2010 targeting .NET framework 4.0 and used the Cookie Aware version of WebClient class.

The authentication cookie is stored and the files were downloaded successfully.

Unfortunately the code doesn't work once I started targeting .NET framework 3.5

To make the authentication cookie to be stored, the authentication need to be performed twice to make it to work in .NET framework 3.5

No comments:

Post a Comment