The Visual Basic .NET and C# Surrounding Code

The first lines of Listing 6 and Listing 7 are optional shorthand statements for declaring that the application uses one or more classes in the DirectoryServices namespace. In plain English, if you don't include these optional statements in the code, you would have to use longhand for writing each line of code. For example, on the first lines of Listing 3 and Listing 4, you would have to change DirectoryEntry to System.DirectoryServices.DirectoryEntry. The Module keyword in Listing 6 and the class keyword in Listing 7specify names of code blocks, and the surrounding brackets define code in the blocks. The Sub keyword with the Main() parameter in Listing 6 and the static and void keywords with the Main(string\[\] args) parameter in Listing 7 specify the starting points (in programming terms, the entry points) for the code in the applications. For more information about this surrounding code, see the Visual Basic .NET and C# Programmer's Reference guides in the Microsoft Developer Network (MSDN) Library.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.