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