1
Answer

message after login

MR alaa

MR alaa

8y
330
1
hi everybody i work with windows form web browers control i want to show message of sucess login or fail after passing info to web page 
 
  1. private void btnlog_Click(object sender, EventArgs e)  
  2.       {  
  3.           if (webBrowserlogin.Url.PathAndQuery == ("/bbbb/login.aspx"))  
  4.           {  
  5.   
  6.               HtmlElement ele = webBrowserlogin.Document.GetElementById("TextBox1");  
  7.               if (ele != null)  
  8.                   ele.InnerText = txt1.Text.Trim();  
  9.   
  10.               ele = webBrowserlogin.Document.GetElementById("TextBox2");  
  11.               if (ele != null)  
  12.                   ele.InnerText = txt2.Text.Trim();  
  13.   
  14.               ele = webBrowserlogin.Document.GetElementById("TextBox3");  
  15.               if (ele != null)  
  16.                   ele.InnerText = txt3.Text.Trim();  
  17.   
  18.   
  19.               var theElementCollectionChildNext = webBrowserlogin.Document.GetElementsByTagName("input");  
  20.               foreach (HtmlElement elChild in theElementCollectionChildNext)  
  21.               {  
  22.                   if (elChild.Id == "Button5")  
  23.                   {  
  24.                       elChild.InvokeMember("click");  
  25.                       break;  
  26.                   }  
  27.               }  
  28.   
  29.           }  
  30.   
  31.   
  32.       }  
 

Answers (1)