Visual Studio 2010片段-当前日期 [英] Visual Studio 2010 Snippets - Current Date

查看:182
本文介绍了Visual Studio 2010片段-当前日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Visual Studio 2010中为文件头制作一个代码段。我希望在执行代码段时都匹配日期。

I'm making a snippet for a file header in Visual Studio 2010. I want the date to match whenever the snippet was executed. Is this possible?

推荐答案

据我所知,您无法执行摘要中的任何代码,例如

As far as I'm aware your not able to execute any code in a snippet, such as

DateTime.Now()

没有其他方法可以做到。我一直在尝试自己做类似的事情。

And there is no other way to do it. I've looked into this as I was trying to do something similar myself.

对不起!

就像@AJM建议编写一个宏并将其分配给键盘快捷键

The alternative is as @AJM suggests to write a macro and assign it to a keyboard shortcut

这篇关于Visual Studio 2010片段-当前日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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