May 2004
Intermediate to advanced
888 pages
22h 31m
English
This section shows you how to create a short program in C# that will do a more complete test of the mono environment. Open an editor on the Linux machine: For this example, we will use gedit; however, any editor will do. (If you prefer, type command_line_applications, run vi, or emacs at the command prompt). Enter the following code:
using System;
class Hello
{
public static void Main(String[] args) {
Console.WriteLine("Mono is working...");
for (int i = 0; i < args.Length; i++)
Console.WriteLine("{0}. Hello {1}!", i, args[i]);
}
}Find the Code on the CD: \Code\Chapter 08\Ex01.
Save the file as hello.cs, and open a terminal window. Navigate to the location of hello.cs and execute
$ mcs hello.cs
If all is well, ...
Read now
Unlock full access