mshtml.HTMLDocumentClass doc = (mshtml.HTMLDocumentClass)IE.Document;
object script= doc.Script;
object[] args = { FirstArgument , "FrameContent", "tree.aspx", "FrameNav" };
script.GetType().InvokeMember("ZweiFrames",
System.Reflection.BindingFlags.InvokeMethod,
null, script,args);
Marshal.ReleaseComObject(script);我使用上面的代码来执行java脚本并得到一个错误。(异常已被调用的目标抛出)(内部异常:内存不足,无法继续执行程序)。
请在这方面帮助我..。
提前谢谢..尤妮。
发布于 2011-04-21 13:57:38
你有没有检查过ZweiFrames js函数--可能是你提供的参数在该函数中有问题?
顺便说一句,另一种执行javascript函数的方法可能类似于
HTMLWindow2 iHtmlWindow2 = (HTMLWindow2) doc.Script ;
iHtmlWindow2.execScript( "functionName(param1);" , "javascript" );当然,这是假设您的参数可以以字符串形式表示。
https://stackoverflow.com/questions/5739997
复制相似问题