Once you have installed visual Studio. NET, you are ready to start writing your first project. In Visual Studio. NET, rarely starts with a blank file, typing the C # code from scratch, and writing the project in a way that tells Visual Studio first. NET what type of project to create, and then visual Studio. NET automatically generates files and C # code, giving the basic framework for that type of project. Then, the user can add their own code in it. For example, if you are writing an application that is based on a Windows GUI interface (in. NET, which is called a Windows Form), Visual Studio. NET creates a file that contains the C # source code to create a basic form that communicates with Windows and receives events. It can also maximize, minimize, and resize, and the user simply adds controls or other features to it. If your application is designed to be a command-line tool (a console application), Visual Studio. NET provides a basic namespace, class, and Main () method.
Finally, when you create a project, Visual Studio. NET also sets the compilation options provided to the C # compiler-whether the project is compiled as a command-line application, a library, or a Windows application. It also tells the compiler that it needs a reference base Class library (Windows GUI applications need to refer to many windows.forms-related libraries that console applications do not need). Of course, if necessary, users can modify these settings while editing.
Start Visual Studio for the first time. NET, the window that appears is called the Start page, as shown in Figure 1.3. This start page is an HTML page that contains links to open existing projects, or to start a new project.
Figure 1.3
1. Select project Type
When you create a new project, you can either click the Create Project button on the Start page, or click the File menu and select New ︱ project. Whichever way you use it, the New Project dialog box appears, as shown in Figure 1.4, which gives you the various items you can create.
Figure 1.4
This dialog box requires the user to select Visual Studio. NET generates some initial framework files and code, compilation options for the user, and the compiler used to compile the code: C #, VB.net, J #, or Visual C + +. NET compiler. As you can see from here, Microsoft provides multiple language integration for. NET. For this example, we selected the C # console application.
In the area of C + +, Visual Studio. NET can create all the old C + + project types--MFC applications, alt projects, and so on. In terms of vb.net, there are some changes in options, for example, you can create vb.net command-line applications (console applications),. NET component (class library) or. NET control (Windows Control Library), but you cannot create a COM-based, old-style control (. NET control can replace this ActiveX control.
Table 1.1 lists the major projects that Visual C # projects can create:
Table 1.1