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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.
Sorry!
The alternative is as @AJM suggests to write a macro and assign it to a keyboard shortcut