using CefSharp; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace FOW0000 { public partial class fHappyNarae : Form { public fHappyNarae() { InitializeComponent(); this.wb1.FrameLoadEnd += Wb1_FrameLoadEnd; this.wb1.AddressChanged += Wb1_AddressChanged; this.wb1.StatusMessage += Wb1_StatusMessage; } private void Wb1_StatusMessage(object sender, StatusMessageEventArgs e) { sbstat.Text = e.Value; } private void Wb1_AddressChanged(object sender, AddressChangedEventArgs e) { sburl.Text = e.Address; } private void Wb1_FrameLoadEnd(object sender, FrameLoadEndEventArgs e) { Console.WriteLine("Frame End : " + e.Url); ; //if (e.Url.Contains("logfail.jsp?LoginDNS=null")) //{ // var frame = this.wb1.GetMainFrame(); // var visitor = new SourceVisitor((text) => // { // BeginInvoke(new Action(() => // { // MessageBox.Show(text.Substring(0, 100)); // })); // }); // frame.GetSource(visitor); //} } //public class SourceVisitor : IStringVisitor //{ // private readonly Action _callback; // public SourceVisitor(Action callback) // { // _callback = callback; // } // public override void Visit(string value) // { // _callback(value); // } // public override Dispose() // { // } //} private void fHappyNarae_Load(object sender, EventArgs e) { wb1.Load("https://www.happynarae.com/fullsize/frist_web/logfail.jsp?LoginDNS=null"); } private void toolStripButton1_Click(object sender, EventArgs e) { wb1.Load("https://www.happynarae.com/fullsize/frist_web/logfail.jsp?LoginDNS=null"); } private void toolStripButton2_Click(object sender, EventArgs e) { var script = "f_sub_menu_click("/havis/havis_custom/202auth/order/cust_order_05.jsp","/havis/fullsize/help_desk/202auth/main/cust_order_05.html","3");"; script = script.Replace(""", "\""); var command = string.Format(script); this.wb1.GetMainFrame().ExecuteJavaScriptAsync(command); } } }