Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            //  webCom.ExecuteScriptAsync("xxx()");  //调用js方法
            // webCom.GetBrowser().MainFrame.ExecuteJavaScriptAsync("alert('这是c#调用的js,给文本框赋值!')");  //调用js方法

            webCom.GetBrowser().MainFrame.ExecuteJavaScriptAsync("document.getElementById('EmployeeID').value='admin'"); //调用控件赋值
            webCom.GetBrowser().MainFrame.ExecuteJavaScriptAsync("document.getElementById('Password').value='d2nzjy'");  //调用控件赋值
            webCom.GetBrowser().MainFrame.ExecuteJavaScriptAsync("document.getElementById('btnLogin').click()");         //调用控件赋值
        }
Ejemplo n.º 2
0
 public static string GetCurrentUrl(this CefSharp.WinForms.ChromiumWebBrowser Browser) => Browser.GetBrowser().GetCurrentUrl();
Ejemplo n.º 3
0
 public static void WaitForLoad(this CefSharp.WinForms.ChromiumWebBrowser Browser)
 {
     Browser.WaitInitialize();
     Browser.GetBrowser().WaitForLoad();
 }