Getting Started

In keeping with programming tradition, Listing D.1 outlines our first program: “Hello, world”.

Listing D.1. The classic "Hello, world" program, hello.cs.
using System;


class Hello
{
        static void Main() {
            // write "Hello, world!" to the screen
            Console.WriteLine("Hello, world!");
        }
}

Developers with experience in ASP/VBScript should note that the C# language is case sensitive and requires a semicolon at the end of statements like JavaScript. By following convention, we save the source code for our program with a .cs file extension, hello.cs. We can compile our program using the .NET command-line compiler, csc.exe, using the following ...

Get ASP.NET by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.