abdullah

abdullah

  • NA
  • 11
  • 569

Automatically log in to your website using c#

Jun 3 2018 1:06 PM
 Hello There,
https://coinpot.co/signin I want to automatically login to this page. I automatically fill in the required fields for this, but when I click on the button, the input is not realized.

I wrote my c # code as follows.

  1. webBrowser1.Document.GetElementById("SignInEmailInput").SetAttribute("value", email);  
  2.   webBrowser1.Document.GetElementById("SignInPasswordInput").SetAttribute("value", pass);  
  3.   
  4.         HtmlElementCollection elc = webBrowser1.Document.GetElementsByTagName("button");  
  5.         foreach (HtmlElement el in elc)  
  6.         {  
  7.             if (el.GetAttribute("type").Equals("submit"))  
  8.             {  
  9.                 el.InvokeMember("Click");  
  10.   
  11.             }  
  12.         } 
 When I check the page's login button, a script is running.
 
Button html:
  1. <button type="submit" class="btn btn-outline btn-info" data-bind="click: signIn">Sign In</button> 

Button JScript:

  1. function(b) {  
  2.   var g, m = d()[h];  
  3.   if (m) {  
  4.     try {  
  5.       var k = a.a.O(arguments);  
  6.       e = f.$data;  
  7.       k.unshift(e);  
  8.       g = m.apply(e, k)  
  9.     } finally {  
  10.       !0 !== g && (b.preventDefault ? b.preventDefault() : b.returnValue = !1)  
  11.     }!1 === c.get(h + "Bubble") && (b.cancelBubble = !0, b.stopPropagation && b.stopPropagation())  
  12.   }  

I do not know about JavaScript. I need your help in coding so I can fix the problem.
Thank you all very much.

Answers (1)