共用方式為


<code> (Visual Basic)

更新:2007 年 11 月

表示文字是多行的程式碼。

 <code>content</code>

參數

  • content
    要標記為程式碼的文字。

備註

使用 <code> 標記 (Tag),將多行標示為程式碼。使用 <c> (Visual Basic),表示在一段描述中應該標記為程式碼的文字。

使用 /doc 進行編譯,將文件註解處理為檔案。

範例

這個範例會使用 <code> 標記,來包含使用 ID 欄位的範例程式碼。

Public Class Employee
    ''' <remarks>
    ''' <example> This sample shows how to set the <c>ID</c> field.
    ''' <code>
    ''' Dim alice As New Employee
    ''' alice.ID = 1234
    ''' </code>
    ''' </example>
    ''' </remarks>
    Public ID As Integer
End Class

請參閱

參考

建議可用於文件註解的 XML 標記 (Visual Basic)