首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在VS2017的*.licenseheader文件中动态添加文件名和日期?

如何在VS2017的*.licenseheader文件中动态添加文件名和日期?
EN

Stack Overflow用户
提问于 2018-08-01 13:53:08
回答 1查看 168关注 0票数 0

我已经安装了来自https://marketplace.visualstudio.com/items?itemName=StefanWenig.LicenseHeaderManager的许可证头管理器。

我需要添加文件名和添加许可证头的日期。

extensions: designer.cs generated.cs
extensions: .cs .cpp .h
/**
* Project Name
* File Name: Test.cs
* Description : Something about the file
* @2018(Year or Date) Company Name Inc. All rights reserved
**/
extensions: .aspx .ascx
<%-- 
/**
* Project Name
* File Name: Test.cs
* Description : Something about the file
* @2018(Year or Date) Company Name Inc. All rights reserved
**/
--%>
extensions: .vb
'Sample license text.
extensions:  .xml .config .xsd
<!--
/**
* Project Name
* File Name: Test.cs
* Description : Something about the file
* @2018(Year or Date) Company Name Inc. All rights reserved
**/
-->

是否可以动态添加它,或者是否有更好的方法?请帮帮我。提前谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-08-01 17:01:59

最后,我找到了动态定义文件名和创建日期时间的方法。我们可以使用"%FileName%""%CreationYear%"等。

例如:

extensions: designer.cs generated.cs
extensions: .cs .cpp .h
/**
* Project Name
* File Name: %FileName%
* @%CreationYear%(To display Year) Company Name Inc. All rights reserved
**/

有关详细信息,请参见

https://github.com/rubicon-oss/LicenseHeaderManager/wiki/Expendable-Properties

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51626156

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档