July 2008
Intermediate to advanced
1026 pages
27h 59m
English
All programming languages supported by Visual Studio provide a method for adding inline documentation. By default, all inline comments are highlighted in green.
Visual Basic .NET uses a single quote character to denote anything following it to be a comment, as shown in the following code listing:
Public Sub New(ByVal Username As String, ByVal Password As String) ' This call is required by the Windows Form Designer. InitializeComponent() ' Perform the rest of the class initialization, which for now ' means we just save the parameters to private data members _username = Username 'This includes the domain name _password = Password End Sub
C# supports both single-line comments and comment blocks. Single-line comments are denoted by // at the beginning of the comment. Block comments typically span multiple lines and are opened by /* and closed off by */, as shown in the following code listing:
public UserRights(string Username, string Password)
{
// This call is required by the Windows Form Designer.
InitializeComponent();
/*
* Perform the rest of the class initialization, which for now
* means we just save the parameters to private data members
*/
_username = Username; //This includes the domain name
_password = Password;
}
Read now
Unlock full access