Download presentation
Presentation is loading. Please wait.
Published byMaude Goodwin Modified over 9 years ago
1
Beginning Programming with the Visual Studio.NET Environment
2
Visual Studio.NET is a tool-rich programming environment containing all the functionality you'll need to create large or small C# projects. Visual Studio.NET is a tool-rich programming environment containing all the functionality you'll need to create large or small C# projects. (You can even create projects that seamlessly combine modules from different languages.) (You can even create projects that seamlessly combine modules from different languages.)
3
In the first exercise, you'll start the Visual Studio.NET programming environment and learn how to create a console application. In the first exercise, you'll start the Visual Studio.NET programming environment and learn how to create a console application.
4
In the Project Types pane, click the Visual C# Projects folder. In the Project Types pane, click the Visual C# Projects folder. In the Templates pane, click the Console Application icon. (You might need to use the Templates pane scrollbar to reveal this icon.) In the Templates pane, click the Console Application icon. (You might need to use the Templates pane scrollbar to reveal this icon.) In the Location field, type C:\Visual C# Step by Step\Chapter 1. In the Location field, type C:\Visual C# Step by Step\Chapter 1. In the Name field, type TextHello. In the Name field, type TextHello. Click OK. The new project opens. Click OK. The new project opens.
5
The menu bar provides access to the commands you'll use in the programming environment. You can use the keyboard or the mouse to access the menus and commands exactly as you can in all Windows-based programs. The menu bar provides access to the commands you'll use in the programming environment. You can use the keyboard or the mouse to access the menus and commands exactly as you can in all Windows-based programs. The toolbar is located beneath the menu bar and provides button shortcuts to run the most frequently used commands The toolbar is located beneath the menu bar and provides button shortcuts to run the most frequently used commands
6
The Code pane displays the source files. In a multi- file project, each source file has its own tab labeled with the name of the source file. You can click the tab once to bring the named source file to the foreground in the Code pane. The Code pane displays the source files. In a multi- file project, each source file has its own tab labeled with the name of the source file. You can click the tab once to bring the named source file to the foreground in the Code pane. The Solution Explorer displays the names of the files associated with the project. You can also double-click a filename in the Solution Explorer to bring that source file to the foreground in the Code pane. The Solution Explorer displays the names of the files associated with the project. You can also double-click a filename in the Solution Explorer to bring that source file to the foreground in the Code pane.
7
The Output pane lists the diagnostic messages generated from build commands. The Output pane lists the diagnostic messages generated from build commands.
8
Before writing the code, examine the files listed in the Solution Explorer that Visual Studio.NET has created as part of your project: Before writing the code, examine the files listed in the Solution Explorer that Visual Studio.NET has created as part of your project: TextHello.slnThis is the top-level solution file, of which there is one per application. Each solution file contains one or more project files. In the file system, each solution file has the extension.sln. In the Solution Explorer, it appears with a name that is easier to read, such as "Solution ‘TextHello'" in this project. TextHello.slnThis is the top-level solution file, of which there is one per application. Each solution file contains one or more project files. In the file system, each solution file has the extension.sln. In the Solution Explorer, it appears with a name that is easier to read, such as "Solution ‘TextHello'" in this project. TextHello.csprojThis is a C# project file. Each project file contains one or more source files. The source files in a single project must be written in the same programming language. This file type is displayed in the Solution Explorer using only the project's name; however, it is stored on the file system with the extension.csproj. TextHello.csprojThis is a C# project file. Each project file contains one or more source files. The source files in a single project must be written in the same programming language. This file type is displayed in the Solution Explorer using only the project's name; however, it is stored on the file system with the extension.csproj. Class1.csThis is a C# source file. You will write your code in this file. It contains some code that Visual Studio.NET provides automatically, which you will examine shortly. Class1.csThis is a C# source file. You will write your code in this file. It contains some code that Visual Studio.NET provides automatically, which you will examine shortly. AssemblyInfo.csThis is another C# source file. You can use this file to add attributes to your program, such as the name of the author, the date the program was written, and so on. There are other more advanced attributes you can use to modify the way in which the program will run. AssemblyInfo.csThis is another C# source file. You can use this file to add attributes to your program, such as the name of the author, the date the program was written, and so on. There are other more advanced attributes you can use to modify the way in which the program will run. App.icoThis is the icon that is associated with the application. All Windows applications that have a user interface have an icon that appears minimized on the taskbar when the application is running. App.icoThis is the icon that is associated with the application. All Windows applications that have a user interface have an icon that appears minimized on the taskbar when the application is running.
9
Create a console application in Visual Studio.NET In Microsoft Windows, click the Start button, point to All Programs, and then point to Microsoft Visual Studio.NET 2003. In Microsoft Windows, click the Start button, point to All Programs, and then point to Microsoft Visual Studio.NET 2003. Click the Microsoft Visual Studio.NET 2003 icon. Visual Studio.NET starts. Click the Microsoft Visual Studio.NET 2003 icon. Visual Studio.NET starts. On the File menu, point to New, and then click Project. The New Project dialog box opens. This dialog box allows you to create a new project using various templates such as Windows Application, Class Library, and Console Application that specify the type of application you want to create. On the File menu, point to New, and then click Project. The New Project dialog box opens. This dialog box allows you to create a new project using various templates such as Windows Application, Class Library, and Console Application that specify the type of application you want to create.
10
Writing Your First Program The Class1.cs file defines a class called Class1 that contains a method called Main. All methods must be defined inside a class. The Main method is special—it designates the program's entry point. It must be a static method. The Class1.cs file defines a class called Class1 that contains a method called Main. All methods must be defined inside a class. The Main method is special—it designates the program's entry point. It must be a static method. Write the code using IntelliSense technology Write the code using IntelliSense technology
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.