【发布时间】:2023-04-07 15:49:02
【问题描述】:
有没有办法禁用 Visual Studio Web 浏览器?我只是希望它在我按住 ctrl 单击评论中的超链接时启动我的实际浏览器。
我看到Tools --> Options 上的Environment 选项卡中有一个Web Browser 选项...但似乎没有办法完全禁用它。
如果没有本地方法,欢迎扩展。
所以当我点击评论时(这里的示例显示了 XML 文件中的评论)
我希望它启动 Chrome,而不是 Visual Studio 中的这个内置 IE 选项卡
编辑我将此问题标记为与另一个问题重复。有人提供了这个宏:
Sub OpenURLInChrome()
' Select to end of line
DTE.ActiveDocument.Selection.EndOfLine(True)
Dim selection As TextSelection = DTE.ActiveDocument.Selection
' Find URL within selection
Dim match = System.Text.RegularExpressions.Regex.Match(selection.Text, ".*(http\S+)")
Dim url As String = ""
If (match.Success) Then
If match.Groups.Count = 2 Then
url = match.Groups(1).Value
End If
End If
' Remove selection
selection.SwapAnchor()
selection.Collapse()
If (url = String.Empty) Then
MsgBox("No URL found")
End If
'launch chrome with url
System.Diagnostics.Process.Start(url)
End Sub
然后bind it to a key 并通过将光标设置在 URL 的开头,然后按热键来使用它。比突出显示整个内容以复制/粘贴到浏览器中要容易一些。
【问题讨论】:
标签: visual-studio-2010 visual-studio