第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

求救大俠 關(guān)于winfrom嵌套html 調(diào)用js問(wèn)題

求救大俠 關(guān)于winfrom嵌套html 調(diào)用js問(wèn)題

至尊寶的傳說(shuō) 2018-07-22 10:04:20
js 代碼由于是原型的調(diào)用無(wú)法完成代碼:我也把 oGthinkrace賦值給 window.tk=oGthinkrace;后臺(tái)也調(diào)用不了 后臺(tái)代碼: var ele = webBrowser.Document.GetElementById("map_canvas");            if (ele != null) {                object ss = ele.InvokeMember("div.Obj.Locate", new object[] { "abcdee1111" });             }
查看完整描述

2 回答

?
慕哥9229398

TA貢獻(xiàn)1877條經(jīng)驗(yàn) 獲得超6個(gè)贊

public static void ExecuteGlobalScript(WebBrowser browser, string script)
        {            if (string.IsNullOrWhiteSpace(script))                return;            if (browser.Document == null
                || browser.Document.Window == null
                || browser.Document.Window.DomWindow == null)                return;            try
            {                var win = (IHTMLWindow2)browser.Document.Window.DomWindow;
                win.execScript(script);
            }            catch (Exception ex)
            {
                Debug.Print("{0}\t執(zhí)行腳本時(shí)發(fā)生錯(cuò)誤:{1}", DateTime.Now, ex.Message);
            }
        }        public static object ExecuteScript(WebBrowser browser, string script, object[] args = null)
        {            if (string.IsNullOrWhiteSpace(script))                return null;            if (browser.Document == null
                || browser.Document.Window == null
                || browser.Document.Window.DomWindow == null)                return null;            var win = (IHTMLWindow2)browser.Document.Window.DomWindow;            var scriptName = string.Format("WebBrowserInjectedMethod{0}", Math.Abs(DateTime.Now.ToBinary()));
            script = string.Format("function {0}(){{{1}}}", scriptName, script);            try
            {
                win.execScript(script, "javascript");                var result = browser.Document.InvokeScript(scriptName, args);                return result;
            }            catch (Exception ex)
            {
                Debug.Print("{0}\t執(zhí)行腳本時(shí)發(fā)生錯(cuò)誤:{1}", DateTime.Now, ex.Message);                return null;
            }
        }


查看完整回答
反對(duì) 回復(fù) 2018-07-23
  • 2 回答
  • 0 關(guān)注
  • 397 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)