Does anybody know best aproach for work with web forms(open/fill/submit) ?
For example there is an page: http://vkontakte.ru/login.php?app=111&layout=popup&type=browser How to open it from C#, fill email and password and send to server.
Does anybody know best aproach for work with web forms(open/fill/submit) ?
For example there is an page: http://vkontakte.ru/login.php?app=111&layout=popup&type=browser How to open it from C#, fill email and password and send to server.
I would use Fiddler to monitor what is sent in the POST data when you submit the page. (Also, it's better to give example sites with English text as most people on SO don't read Cyrillic)
Then I would use HttpWebRequest and perform the same POST from code. Example of doing a POST can be found at http://www.netomatix.com/httppostdata.aspx.
Hey,
I can think of one approach to do that:
1) Check where the form submits to. Normally, form have an action tag indicating the url to which the form info is sent.
2) Check the http method.
3) Collect the names of the input fields in the form. Your variables in asp.net have to be named with the same names.
4) Create a manual web request to this url using this method and attach all the variables you need to send.
Some example code:
HttpWebRequest request = HttpWebRequest.Create("yourFormUrl");
request.Method = "POST"
Hope that this is what you want to do.