This page acts as a good example for my problem :

http://valums.com/files/2009/ajax-upload/demo-jquery.htm

If you click on the browse button and select a file, the file will be uploaded ajax-style (without posting the whole webpage).

I am developing a C# WinForm application where a WebBrowser control allows me to parse and fill forms automatically and I need to upload a file without opening the "File Browse" window which steals focus away from other windows.

How can this be achieved ?

有帮助吗?

解决方案

Since you have one specific page you want to automatically populate it's going to be a lot easier to recreate the POST message that is generated using either the WebClient or a HttpWebRequest.

A good code example can be found here and a good tool (one of many though) to see the data that gets posted is fiddler2

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top