My question is as exact as it is. I am wondering if it would be possible to insert the date or the date and time into a comment without having to manually write it out. But what I would really like to know is, is there a way to do this and will I have to implement something with visual studio to do this for me and if so, how can I do this? Any help will be greatly appreciated! :)
Also, I am coding in C-Sharp and am using Visual Studio 2010.
相关问题
- How to know full paths to DLL's from .csproj f
- Importing NuGet references through a local project
- Visual Studio 2019 - error MSB8020: The build tool
- 'System.Threading.ThreadAbortException' in
- Visual Studio 2010 randomly says the command line
相关文章
- How to show location of errors, references to memb
- Macro expansion in elixir: how to define 2 macros
- Log4Net Multiple Projects
- How to track MongoDB requests from a console appli
- Compiling error in C++ project with C and C++ code
- Visual Studio Hangs on Loading UI Library
- How to use Mercurial from Visual Studio 2010?
- VSIX: execute code on VS startup
You could either write a macro in Visual Studio or use some external program (such as AutoHotKey) to type the text for you.
In Visual Studio 2010 you write macros in Visual Basic and add them to the Macro Explorer. Then call the macros while working in your C# code editor. I bind my favorite macros to key combinations, so I can quickly run them when needed.
If you are new to macros and the Visual Studio Macro editor check out this link. MSDN docs for Macros
Here is the code to add a comment and date to your C# code.
Here's the results in a C# file.
When someone posts a comment and you process the form data on your serverside, maybe you would add a hard return (
or chr(13)) and then add the date BEFORE persisting the comments to a database or xml file.
so you would end up with something like....
or