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

时间:2018-08-01 05:53:08

标签: c# visual-studio visual-studio-2017

我已经从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
**/
-->

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

1 个答案:

答案 0 :(得分:0)

最后,我找到了定义文件名和动态创建日期时间的方法。 我们可以使用“%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