本文整理汇总了C#中WebBrowser.RunScript方法的典型用法代码示例。如果您正苦于以下问题:C# WebBrowser.RunScript方法的具体用法?C# WebBrowser.RunScript怎么用?C# WebBrowser.RunScript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebBrowser
的用法示例。
在下文中一共展示了WebBrowser.RunScript方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RunScriptWithInvalidLanguageTest
public void RunScriptWithInvalidLanguageTest()
{
WebBrowser browser = new WebBrowser(_browserType);
browser.RunScript("JAVA", "using SWAT; class test{public static string Main(){return 5==5?\"true\":\"false\";}}", "true");
}
示例2: RunScriptCSharpVariableSaveAndRecallTest
public void RunScriptCSharpVariableSaveAndRecallTest()
{
Dictionary<string, string> variables = new Dictionary<string, string>();
variables.Add("key1", "value");
WebBrowser browser = new WebBrowser(_browserType, new SWAT_Editor.Controls.EditorVariableRetriever(variables));
browser.RunScript("CSHARP", "namespace SWAT{class test{public static string Main(){swatVars.Save(\"key2\", \"yo son\"); return swatVars.Recall(\"key1\");}}}", "value", "");
browser.RunScript("CSHARP", "namespace SWAT{class test{public static string Main(){return swatVars.Recall(\"key2\");}}}", "yo son", "");
}
示例3: RunScriptCSharpWorksWithoutOpenBrowserTest
public void RunScriptCSharpWorksWithoutOpenBrowserTest()
{
WebBrowser browser = new WebBrowser(_browserType);
browser.RunScript("CSHARP", "using SWAT; class test{public static string Main(){return 5==5?\"true\":\"false\";}}", "true");
}