打开Chrome标签并关闭它 [英] Open a Chrome Tab and Close it

查看:139
本文介绍了打开Chrome标签并关闭它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

我的问题是,如果我点击button1谷歌浏览器是打开的。

如果我点击button2我想要打开雅虎浏览器和谷歌浏览器关闭它。

我不想关闭整个浏览器,只关闭我打开的标签。

希望我能从你们那里得到一些解决方案或想法〜

Hi!
My Questions is if i clicked button1 google browser is open.
If i clicked button2 i want yahoo browser open and google browser close it.
I dont want to close the whole browser, just the tab I opened.
Hope i can get some solutions or idea from you guys~

private void button1_Click(object sender, EventArgs e)
        {
           Process.Start("http://www.google.com");
        }

private void button2_Click(object sender, EventArgs e)
        {
            Process.Start("http://www.yahoo.com");
        }

推荐答案

ProcessStartInfo startInfo=new ProcessStartInfo("chrome.exe", "http://www.google.com/");
            Process.Start(startInfo) ;


这篇关于打开Chrome标签并关闭它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆