有人知道我可以插入当前日期&时间在视觉工作室2008片段?我想要的是在我的.snippet
文件的正文中这样的东西…
- <Code Language="csharp">
- <![CDATA[
- // $DateTime$
- // more code here for my snippet...
- </Code>
没有DateTime
函数可用于
代码片段,但这里是一个宏,它将插入当前的DateTime:
- Sub PrintDateTime()
- If (Not IsNothing(DTE.ActiveDocument)) Then
- Dim selection As TextSelection = DTE.ActiveDocument.Selection
- selection.Insert(DateTime.Now.ToString())
- End If
- End Sub
您可以使用Alt F8打开您的宏浏览器,并创建一个新模块,并将代码粘贴到生成的模块内.
然后创建一个新的键盘快捷键并将其绑定到您的宏.