本文整理汇总了C#中WebBrowser.KillAllOpenBrowsers方法的典型用法代码示例。如果您正苦于以下问题:C# WebBrowser.KillAllOpenBrowsers方法的具体用法?C# WebBrowser.KillAllOpenBrowsers怎么用?C# WebBrowser.KillAllOpenBrowsers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebBrowser
的用法示例。
在下文中一共展示了WebBrowser.KillAllOpenBrowsers方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: KeyboardCopyWorksTest
public void KeyboardCopyWorksTest()
{
browser = new WebBrowser(BrowserType.FireFox);
IBrowser browserObj = (IBrowser) ReflectionHelper.GetField<object>(browser, "_browser");
KeyboardInput input = new KeyboardInput(browserObj);
browser.OpenBrowser();
browser.NavigateBrowser("http://www.google.com");
input.Copy(GetTestWindowHandle("Google"));
browser.KillAllOpenBrowsers();
}
示例2: TestPressKeysInSixtyFourBit
public void TestPressKeysInSixtyFourBit()
{
browser = new WebBrowser(BrowserType.InternetExplorer);
IBrowser browserObj = (IBrowser) ReflectionHelper.GetField<object>(browser, "_browser");
KeyboardInput input = new KeyboardInput(browserObj);
browser.OpenBrowser();
browser.NavigateBrowser("http://www.google.com");
try
{
ReflectionHelper.SetField(input, "forceSixtyFourBit", true);
input.ProcessKey(NativeMethods.VkKeyScan('a'));
input.SendInputString(browserObj.GetCurrentWindowTitle());
}
finally
{
// Clean up
ReflectionHelper.SetField(input, "forceSixtyFourBit", false);
browser.KillAllOpenBrowsers();
}
}
示例3: Setup
public virtual void Setup()
{
try
{
SafariSettings.SafariAddress = "120.0.0.1";
SWAT.WantSuspendOnFail.SuspendTestOnFail = false;
UserConfigHandler.Save();
_browser = new WebBrowser(_browserType);
iBrowserInstance = ReflectionHelper.GetField<IBrowser>(_browser, "_browser");
this.OpenSwatTestPage();
}
catch //If set up fails, try again once more..
{
_browser.Sleep(5000);
_browser.KillAllOpenBrowsers();
_browser = new WebBrowser(_browserType);
iBrowserInstance = ReflectionHelper.GetField<IBrowser>(_browser, "_browser");
this.OpenSwatTestPage();
}
}
示例4: ChromeClosesPortsCorrectlyAfterUseTest
public void ChromeClosesPortsCorrectlyAfterUseTest()
{
_browser = new WebBrowser(BrowserType.Chrome);
_browser.OpenBrowser();
_browser.KillAllOpenBrowsers();
}