Geeks With Blogs
FOXJAZZ developing with .net


I have been searching for a way to use webbrowser control in conjunction with the webclient class to auto authenticate to a website and then to auto-download a file.

I thought I could use webclient.DownloadFile however the website doesn’t get my credentials for which cookies are set when I auto login to the site using the webbrowser control and navigate to the place to download the file.

The webbrowser control doesn’t have a filedownload function as the webclient control does so I thought I could just pass cookies and session from one object to the other, but no that doesn’t seem feasible.

I thought also that I could use the webclient control to navigate the site, but there are not clear methods to post authentication and then to browse through the chain of crazy-ness to get to the place to download the file I need.

I have done hours of research on this and short of writing my own webbrowser control I think I need to give up on this one for a while, or until a more feasible solution is found.

Or maybe I need to use linux and find solutions with open-source.

Microsoft has explanations generally on how to use these controls, but not in conjunction with each other.

Posted on Monday, January 23, 2012 3:06 AM | Back to top

Comments on this post: Day in the life of programming.

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © foxjazz | Powered by: | Join free