简体   繁体   English

如何在Visual Studio 2017中将项目详细信息自动添加到主程序代码

[英]How to auto-add project details to main program code in Visual Studio 2017

I want Visual Studio to automatically add project details like: author, date and time when project was created into comment on top of the main code between 'using' stuff and 'namespace'. 我希望Visual Studio自动在“使用”和“命名空间”之间的主要代码上添加项目详细信息,例如:作者,创建项目的日期和时间作为注释。 I looked hard for this but i didn't find anything intresting. 我为此努力看了一下,但没有发现任何有趣的东西。 I'm using Visual Studio 2017 Community Edition. 我正在使用Visual Studio 2017社区版。 When i do changes to Class.cs file it doesn't appear in VS. 当我对Class.cs文件进行更改时,它不会出现在VS中。 Thanks for any help :) 谢谢你的帮助 :)

using System.Threading;
using System.Text; //And so on

/*There i want my details
  Author: Matias
  Date: 11.03.2018 - 2am
*/

namespace MyNamespace
//Code below

I want to get this added automatically 我想自动添加

Nevermind, got solution! 没关系,得到解决方案! I just had to type 我只需要输入

/**
* Author: $username$
* Date: $time$
*/

in my code and then export the template by Project -> Export template 在我的代码中,然后通过Project-> Export template导出模板

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

相关问题 如何手动将库添加到Visual Studio 2017项目? - How to manually add a library to a visual studio 2017 project? Visual Studio:如何将代码模板添加到项目 - Visual Studio: How to add code templates to project 如何在 Visual Studio 2017 中克隆和重命名项目? - How to clone and rename a project in Visual Studio 2017? 如何从传入的串行数据自动将项目添加到列表? - How to auto-add item to a list from an incoming serial data? 如何在 Visual Studio 2017 中添加服务引用 - How to add service reference in visual studio 2017 程序奇怪地跳过了Xamarin Visual Studio 2017中的一段代码 - Program strangely skipping a piece of code in Xamarin Visual Studio 2017 如何使用 Visual Studio 2017 创建 React 应用程序(无 Visual Studio 代码) - How to create react app with visual studio 2017 (no visual studio code) 无法将WCF服务添加到Project Visual Studio 2017 - Cannot add WCF Service to Project Visual Studio 2017 在Visual Studio 2017安装项目中为卸载添加自定义操作 - Add a custom action on uninstall in Visual Studio 2017 setup project $(TargetDir)对于Visual Studio 2017中的Microsoft Word加载项项目为空 - $(TargetDir) empty for Microsoft Word Add-In project in Visual Studio 2017
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM