更新:2007 年 11 月
指定有关 IntelliSense 代码段的常规信息。
<Header>
    <Title>... </Title>
    <Author>... </Author>
    <Description>... </Description>
    <HelpUrl>... </HelpUrl>
    <SnippetTypes>... </SnippetTypes>
    <Keywords>... </Keywords>
    <Shortcut>... </Shortcut>
</Header>
属性和元素
以下几节描述了属性、子元素和父元素。
属性
无。
子元素
| 元素 | 说明 | 
|---|---|
| 可选的元素。 编写代码段的人员或公司的姓名或名称。Header 元素中可能有零个或一个 Author 元素。 | |
| 可选的元素。 代码段说明。Header 元素中可能有零个或一个 Description 元素。 | |
| 可选的元素。 包含有关代码段的更多信息的 URL。Header 元素中可能有零个或一个 HelpURL 元素。 | |
| 可选的元素。 对 Keyword 元素进行分组。Header 元素中可能有零个或一个 Keywords 元素。 | |
| 可选的元素。 指定可用于插入代码段的快捷方式文本。Header 元素中可能有零个或一个 Shortcut 元素。 | |
| 可选的元素。 对 SnippetType 元素进行分组。Header 元素中可能有零个或一个 SnippetTypes 元素。如果没有 SnippetTypes 元素,代码段将一直有效。 | |
| 必需的元素。 代码段的友好名称。Header 元素中必须有且仅有一个 Title 元素。 | 
父元素
| 元素 | 说明 | 
|---|---|
| 所有代码段数据的父元素。 | 
示例
下面的代码演示如何设置 Header 元素的子元素的值。
<CodeSnippets xmlns="https://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            <Title>Copy File</Title>
            <Author>Microsoft Corporation</Author>
            <Description>Copies a file and saves it as another file.</Description>
            <HelpUrl>www.microsoft.com</HelpUrl>
            <SnippetTypes>
                <SnippetType>Expansion</SnippetType>
            </SnippetTypes>
            <Keywords>
                 <Keyword>File copying</Keyword>
                 <Keyword>Copying files</Keyword>
            </Keywords>
            <Shortcut>copyfile</Shortcut>
        </Header>
        <Snippet>
            <!-- Insert snippet information here -->
        </Snippet>
    </CodeSnippet>
</CodeSnippets>