Home

A Project

 

Introduction

To create a computer program, also called an application, you create a series of files and group them in an ensemble called a project. This contains various types of files, such as code files, assemblies (or libraries), and resource files.

Author Note These lessons assume that you already know a good deal of the C# language, but only the language. We assume that you have no prior knowledge of graphical application programming. In these lessons, we will create Windows applications, the type referred to a graphical user interface (GUI).

To create most of the files you need for an application, you don't need Microsoft Visual C#. In fact, you can use Notepad to create a completely functional application. All you need is to have the whole .NET Framework, which is freely downloadable from the Microsoft web site. When using this approach, you can use Notepad (or any other text editor) to write your code, save each document appropriately in the folder you would have designated.

Creating a Project

A typical application consists of more than one code file and can even be as complex as you want. To make it faster and a little easier to graphically create an application, you would need a good functioning environment like Microsoft Visual C#. Using it, you can create a new project or you can open an existing one.

To create a Visual C# project, you can display the New Project dialog box. To open the New Project dialog box:

  • On the Start Page, on the right side of Project, click Create...
  • If you are using Microsoft Visual C# 2005 Express Edition, on the main menu, you can click File -> New Project... If you are using Microsoft Visual C# 2005 Professional, on the main menu, you can click File -> New -> Project...
  • On the Standard toolbar, you can click the New Project button New Project
  • You can press Ctrl + Shift + N

In the New Project dialog box, select Visual C# Projects, select the type of project, give it a name, specify its directory, and click OK.

Practical LearningPractical Learning: Creating a Project

  1. On the main menu, click File -> New Project or File -> New -> Project...
  2. In the Templates section, click Console Application
  3. In the Name edit box, type Exercise1
     
    New Project
  4. Accept the name in the  Location text box and click OK. This creates a new project

Compiling and Executing a Project

The instructions created for a Visual C# project are written in plain English in a language easily recognizable to the human eye. After creating the file(s) of a project, you would compile the project to get an executable that becomes ready to be distributed to your users.

To compile and execute a project in one step, on the main menu, you can click Debug -> Start Without Debugging. Although there are other techniques or details in compiling (or debugging) and executing a project, for now, this is the only technique we will use until further notice.

Practical LearningPractical Learning: Executing a Project

  1. To execute the application, on the main menu, click Build -> Build Exercise1

  2. To execute the application, on the Standard toolbar, click the Start Debugging button Start Debugging

Opening a Project

As opposed to creating a new project, you can open a project that either you or someone else created. To open an existing project:

  • On the Start Page, on the right side of Project, click Open...
  • If you are using Microsoft Visual C# 2005 Express Edition, on the main menu, you can click File -> Open Project... If you are using Microsoft Visual C# 2005 Professional, on the main menu, you can click File -> Open -> Project...
  • You can press Ctrl + Shift + O

This action would display the Open Project dialog box. This allows you to select a project and open it.

 

Previous Copyright © 2007 FunctionX, Inc. Next