1
我的Visual Studio扩展生成一个URL,我想在Visual Studio中打开它作为一个新选项卡。VSIX:打开浏览器窗口
我可以使用Process.Start()
打开一个外部浏览器,但这看起来不太好。
我可以从磁盘使用此方法打开文件:
void OnOpenBrowserWindow(string url)
{
if (url != null)
{
IVsCommandWindow service = (IVsCommandWindow) this.GetService(typeof (SVsCommandWindow));
if (service != null)
{
string command = string.Format("File.OpenFile \"{0}\"", url);
service.ExecuteCommand(command);
}
}
}
,但它并不适用于网址
这使我的一天,作为一种魅力! –