The Visual Basic .NET and C# Surrounding Code

Here are the few additional lines of code you need to make the solution work.

Ethan Wilansky

August 15, 2004

1 Min Read
ITPro Today logo

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.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like