It is now time to look at an actual C# program. We will begin by compiling and running the short program shown here:
/*
This is a simple C# program.
Call this program Example.cs.
*/
using System;
class Example {
// A C# program begins with a call to Main().
public static void Main() {
Console.WriteLine("A simple C# program.");
}
}
The primary development environment for C# is Microsoft’s Visual Studio. To compile all of the programs in this book, including those that use the new C# 2.0 features, you will need to use Visual Studio 2005, or later. Using Visual Studio 2005, there are two ways to edit, compile, and run a C# program.
1.Using the command-line compiler, csc.exe.
2.Using the Visual Studio Integrated Development Environment (IDE).
Subscribe to:
Post Comments (Atom)
Archives
-
▼
2008
(167)
-
▼
August
(36)
- Delay Sign an Assembly in C#
- Verify That a Strong-Named Assembly Has Not Been M...
- Give an Assembly a Strong Name in C#
- Create and Manage Strong-Named Key Pairs in C#
- Access a Program Element That Has the Same Name as...
- Selectively Include Code at Build Time in C#
- Access Command-Line Arguments in C#
- Create and Use a Code Library in C#
- Create and Use a Code Module in C#
- Short-Circuit Logical Operators in C#
- Relational and Logical Operators in C#
- Arithmetic Operators in C#
- Type Conversion of Expressions in C#
- C# Type Conversion and Casting
- The Scope and Lifetime of Variables in C sharp
- A Closer Look at Variables in C#
- C# Literals
- C# Some Output Options
- C# The bool Type
- C# Characters
- C# The Decimal Type
- C# Floating-Point Types
- C# Integers
- C# Value Types
- The C# Class Library
- C# Identifiers
- The C# Keywords
- Semicolons, Positioning, and Indentation in C#
- Handling Syntax Errors in C#
- Using the Visual Studio IDE
- Using csc.exe, the C# Command-Line Compiler
- A First Simple Program
- Inheritance
- Polymorphism
- Encapsulation
- C# Object-Oriented Programming
-
▼
August
(36)
No comments:
Post a Comment