用webborwer导航一个网页,网页中有一个Jscript变量,如何在程序中读取它??
解决方案 »
- .net 2.0中 2个集合循环,寻找高效率方法..
- sqlconnection open数据库,局域网慢,远程和本地都快
- vs2008自带的水晶报表有没有时间限制
- 求C#读取并合并两个wmf文件或emf文件成1个文件的代码,马上给分
- 工作流添加到另一项目中 散分,来顶呀
- WPF中,在Property Trigger里面使用自定义的dependency property的问题
- 如何在winform 的datagrid 显示时对列植进行转换? 比如0/1 转为真/假?
- 忍者游戏
- C#中,如何读取控件的值,进行传递!
- c#父窗体和子窗体关闭问题
- 【WinForm学习第二帖】多线程读取文本
- 我找的正则表达式为什么不起作用
--c:\temp\temp.htm--
<html>
<script language="JavaScript">
var Temp = "Zswang 路过 :)";
</script>
</html>using mshtml;private void Form1_Load(object sender, EventArgs e)
{
webBrowser1.Navigate(@"c:\temp\temp.htm");
}private void button1_Click(object sender, EventArgs e)
{
IHTMLDocument2 vDocument = webBrowser1.Document.DomDocument as IHTMLDocument2;
IHTMLWindow2 vWindow = vDocument.parentWindow;
vWindow.execScript("document.title=Temp;", "JavaScript");
Text = vDocument.title;
}