20 Ocak 2016 Çarşamba

c# Awesomium kullanımı

Awesomium WebControl usage and tricks

DOM content manipulate - set HTML

webControl1.HTML = "<html><head><script>alert
('check!');</script></head><body>lorem</body></html>";

DOM content manipulate - get HTML

var allhtml = webControl1.ExecuteJavascriptWithResult
    ("document.documentElement.outerHTML");

Exec Js

webControl1.ExecuteJavascript
("document.body.innerHTML += '<i>Hello, World!</i>';");

Disable Js

var ws = WebCore.CreateWebSession(new WebPreferences() { Javascript = true });
webControl1 = new Awesomium.Windows.Forms.WebControl() { WebSession = ws };
this.Controls.Add(webControl1);

Set proxy

var ws = WebCore.CreateWebSession(new WebPreferences() 
{ ProxyConfig = "255.255.255:8080" });
webControl1 = new Awesomium.Windows.Forms.WebControl() { WebSession = ws };
this.Controls.Add(webControl1);