简体   繁体   English

Visual Studio 2015(VB.NET)中的“ TryCF”

[英]“TryCF” in Visual Studio 2015 (VB.NET)

I just found the very handy "TRYCF" hotkey in VS2015 - for those unaware, you can type "trycf", hit tab and it lays the following out for you: 我刚刚在VS2015中找到了非常方便的“ TRYCF”热键-对于那些不知道的用户,可以键入“ trycf”,单击选项卡,然后为您列出以下内容:

           Try

        Catch ex As ArgumentException

        Finally

        End Try

This would be amazing, and would save me a lot of time in my day to day coding, except the default exception type "ArgumentException" is no good for me, I just want to catch generic exceptions: "ex as exception" 这将是惊人的,并且可以在日常编码中为我节省很多时间,除了默认的异常类型“ ArgumentException”对我没有好处,我只想捕获通用的异常:“ ex as exception”

Does anyone know how I can set VS2015 up so that the default exception is just an "exception"? 有谁知道我该如何设置VS2015,以便默认异常只是一个“异常”?

Cheers. 干杯。

You are invoking a code snippet. 您正在调用代码段。 You could edit the snippet file and change the <Default> tag. 您可以编辑代码段文件并更改<Default>标签。
For VS2015, the path to those snippets is: "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VB\\Snippets\\1033\\common code patterns\\exception handling". 对于VS2015,这些片段的路径为:“ C:\\ Program Files(x86)\\ Microsoft Visual Studio 14.0 \\ VB \\ Snippets \\ 1033 \\通用代码模式\\异常处理”。

A recommended alternative is to copy the subject snippet to your personal snippet folder. 建议的替代方法是将主题代码段复制到您的个人代码段文件夹中。

C:\Users\UserName\Documents\Visual Studio 2015\Code Snippets\Visual Basic\My Code Snippets

Then edit it to change the <Default> tag. 然后对其进行编辑以更改<Default>标签。 Also change the <ShortCut> tag so that it does not conflict with the pre-installed VS snippet. 还要更改<ShortCut>标记,以使其与预安装的VS代码段不冲突。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 vb.net visual studio 2015本地化应用程序安装项目 - vb.net visual studio 2015 setup project of localized application 在 Visual Studio 2015 中使用 VB.NET 发送 Outlook 邮件 - Sending outlook mail using VB.NET in Visual Studio 2015 如何在Visual Studio 2015中更改VB.NET语言版本 - How to change the VB.NET language version in Visual Studio 2015 在Visual Studio 2015(社区)中集成VB.NET和Flash - Integrating VB.NET with Flash in Visual Studio 2015 (Community) 使用Visual Studio 2015的VB.NET安装程序包 - VB.NET Installer Package using Visual Studio 2015 使用Visual Studio 2015更新Access数据库-VB.net - Update Access database using Visual Studio 2015 - VB.net 如何在vb.net中下载exe文件(Visual Studio 2015) - how to download exe files in vb.net (Visual Studio 2015) 如何在vb.net中使用ado.net在Visual Studio 2015中执行MDX查询 - How to execute a MDX Query in Visual studio 2015 using ado.net in vb.net 防止 Visual Studio 2015 删除 VB.NET 文件中的行继续符 (_) - Prevent Visual Studio 2015 from removing line continuation characters (_) in VB.NET files 如何在VB.NET for Visual Studio 2015中显示片段? - How do you make snippets show in VB.NET for Visual Studio 2015?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM