111,094
社区成员




v = 0;
versionInfo[v] = new Array(2);
versionInfo[v][0] = "V0.01";
versionInfo[v][1] = "2013/9/25";
WebBrowser webBrowser = new WebBrowser();
webBrowser.Url = new Uri(@"E:\test.htm");
if (webBrowser.Document != null)
{
HtmlDocument doc = webBrowser.Document;
String str = doc.InvokeScript("test").ToString();
MessageBox.Show(str);
}
<html>
<head>
<title></title>
<SCRIPT>
// Return a string.
function test() {
alert("test");
return("This is a test.");
}
</SCRIPT>
</head>
<body>
</body>
</html>
[/quote]
你确定if分支能进入吗?
WebBrowser webBrowser = new WebBrowser();
webBrowser.Url = new Uri(@"E:\test.htm");
if (webBrowser.Document != null)
{
HtmlDocument doc = webBrowser.Document;
String str = doc.InvokeScript("test").ToString();
MessageBox.Show(str);
}
<html>
<head>
<title></title>
<SCRIPT>
// Return a string.
function test() {
alert("test");
return("This is a test.");
}
</SCRIPT>
</head>
<body>
</body>
</html>