SoFunction
Updated on 2025-03-07

webBrowser executes js method and returns value, and implements the value taken in the background of c#

Examples are as follows:

private void Form1_Load(object sender, EventArgs e)
    {
      ( + @"\");
       = ;
    }
private void button2_Click(object sender, EventArgs e)
    {

      
      ("GetCode", new object[] { "1567613","228267824","Presist one","D7D796981B62D318"});
      if (("msg") != null)
      {
        HtmlElement element = ("msg");
         = ("value");
      }
    

    }
function GetCode(lBdId, lDocId, text, sessionID) {

   ("msg").value = H2(lBdId + '-' + lDocId + '-' + P(text), 16, sessionID);
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
  <head>
    <title></title><script type="text/javascript" src=""></script>
  </head>
  <body>
  <input type=text id=msg />
  </body>
</html>

Use the html page as the medium to pass the returned value to the control in html, and then use it in webBrowser

HtmlElement element = ("msg");
         = ("value")

Get value

The above article of webBrowser executes js method and returns value. The implementation of c# background value is all the content I share with you. I hope you can give you a reference and I hope you can support me more.