zoukankan      html  css  js  c++  java
  • vs新建模板

    1.系统模板路径

    a.项模板:E:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates

    b.项目模板:E:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplates

    2.模板变量

    clrversion
    公共语言运行库 (CLR) 的当前版本。

    GUID [1-10]
    用于替换项目文件中的项目 GUID
    的 GUID。最多可以指定 10 个唯一的 GUID(例如,guid1))。

    itemname 
    用户在添加新项对话框中提供的名称。

    machinename 
    当前的计算机名称(例如,Computer01)。

    projectname 
    用户在新建项目对话框中提供的名称。

    registeredorganization 
    HKLM\Software\Microsoft\Windows NT\CurrentVersion\RegisteredOrganization
    中的注册表项值。

    rootnamespace 
    当前项目的根命名空间。此参数用于替换正向项目中添加的项中的命名空间。

    safeitemname 
    用户在“添加新项”对话框中提供的名称,名称中移除了所有不安全的字符和空格。

    safeprojectname 
    用户在“新建项目”对话框中提供的名称,名称中移除了所有不安全的字符和空格。

    time
    以 DD/MM/YYYY
    00:00:00 格式表示的当前时间。

    userdomain
    当前的用户域。

    username 
    当前的用户名。

    year
    以 YYYY 格式表示的当前年份

    3.新建模板的方法

    新建一个项目,后点击文件菜单中的导出模板,可导出项模板或项目模板

    4.示例

    //===================================================================================
    // Document Instruction
    //===================================================================================
    // Created CLR:$clrversion$
    // Created Time:$time$
    //===================================================================================
    // Copyright (c) Grouppower Corporation.  All Rights Reserved. 
    // http://www.grouppower.com/license
    //===================================================================================


    namespace $rootnamespace$
    {
        using System;
        using System.Collections.Generic;
        $if$ ($targetframeworkversion$ >= 3.5)using System.Linq;
        $endif$using System.Text;

        public class $safeitemname$
        {
            #region 成员变量
            
            #endregion

            #region 构造函数

            public $safeitemname$()
            {
                
            }
        
            #endregion

            #region 属性
        
            #endregion

            #region 方法

            #endregion
        }
    }
  • 相关阅读:
    ROS安装过程与常遇问题
    Linux中Vim工具的使用
    秋招总结
    SpringBoot项目打包war包步骤
    hiredis windows静态库编译
    Access去除字段值后面空格
    AspNetCore容器化(Docker)部署(四) —— Jenkins自动化部署
    AspNetCore容器化(Docker)部署(三) —— Docker Compose容器编排
    AspNetCore容器化(Docker)部署(二) —— 多容器通信
    AspNetCore容器化(Docker)部署(一) —— 入门
  • 原文地址:https://www.cnblogs.com/wudingfeng/p/2304423.html
Copyright © 2011-2022 走看看