Introduction
Most programmers may have heard of a tool javadoc from Java itself; using it automatically generates an HTML document for your code. The C # and C # compilers also have similar functions, but it generates XML instead of directly generating HTML. However, using XML will make the document more flexible.
Note syntax
In order to use the XML annotation feature provided by C #, your annotation should start using a special annotation syntax (/ / /). After ///, you can use a pre-defined label to comment your code or insert your own defined tag. Your custom label will be added to the generated comment document.
Predefined label
provides a method of making multi-line instructions as a code
Insert a list into the XML comment document
describes a parameter
example
The following example adds a comment for our common HelloWorld console applications:
Using system; namespace helloworld {///
CSC /DOC: HelloWorld.xml HelloWorld.cs
The resulting result document is as follows:
XML Version = "1.0"?>
askMBLY>
Sample Hello World in C #
summary>
member>
Console Application Entry Point
Command Line Arguments param>
summary>
member>
members>
doc>
HTML page
You may ask yourself: How should I get the HTML page with a good format? Very simple, you can write your own XSL to convert the generated XML comment document, or use the Visual Studio.net development tool. By using the [Generate Note Web Page] in the [Tools] menu of VS.NET, you can get a series of detailed description of your project or solution HTML page. Below is the HTML page snapshot of the HELLOWORLD program generated by vs.net: