c# - How to fulfill a WebForm using Windows Form Application -


so, there page has form (https://tx3.travian.com.br/dorf1.php) , want fulfill form through windows form application.

i've been trying using code

httpclient client = new httpclient(); string url = "https://tx3.travian.com.br/dorf1.php";  var param = new dictionary<string, string> {     { "name", "nickname" },     { "password", "password" }, }; var content = new formurlencodedcontent(param); var posttask = client.postasync(url, content);   posttask.wait(); var response = posttask.result;  using (var responsetask = response.content.readasstreamasync()) {     responsetask.wait();     var stream = responsetask.result;     streamreader reader = new streamreader(stream);     textbox1.text = reader.readtoend(); } 

when run code, i'm able fill password input, reasons doesn't work account name. inspecting code, believe input field account named "name".

i'm putting answer through textbox because i'm starting project , easiest way , didn't want spend time on yet.

thx

ps: since i'm using code on formload method, can't use assynchronous methods directly. more specific, can't use "await" right now.


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -