层主这个高档方便。我好像干过:VC++, WebBrowser控件,execScript("function xx(){alert('xx')} xx()")
看了下代码,下面理解若有错请指出。
jint = Javascript Interpreter for .NET,提供了Engine和Action类。
Window,不叫Form了,里摆了个控件,用webbrowser访问。
engine.SetValue("doc", webbrowser.Document); doc = webbrowser.Document
engine.SetValue("log", new Action<object>(Console.WriteLine)); log = function() { Console.WriteLine }
...
engine.Execute(script); 执行脚本,script是从文件里ReadToEnd的。
我想练下写英文注释:
Automate Your Web Browser in C#
This program puts a WebBrowser Control in a WPF window, and connects a JavaScript interpreter/engine (jint) with it, so you can execute scripts on web pages. For example, you can have a button clicked in your script. We have added the following functions:
--
FROM 106.121.132.*