Difference between revisions of "Helloworld in csharp"
esse quam videri
Line 4: | Line 4: | ||
# open a text editor (I like to use [http://www.scintilla.org/SciTE.html SCiTE]) | # open a text editor (I like to use [http://www.scintilla.org/SciTE.html SCiTE]) | ||
# type in | # type in | ||
− | :<csharp>using System; | + | :<csharp> |
+ | //HelloWorld in c# | ||
+ | // | ||
+ | //by Jeff Meyers jeff@iam.colum.edu | ||
+ | |||
+ | using System; | ||
namespace HelloClass | namespace HelloClass | ||
{ | { | ||
Line 25: | Line 30: | ||
* use mono to run the HelloWorld.exe created by mcs<br>[[Image:MscHelloworld.png]] | * use mono to run the HelloWorld.exe created by mcs<br>[[Image:MscHelloworld.png]] | ||
mono HelloWorld.exe | mono HelloWorld.exe | ||
+ | |||
+ | 6 Post to your oop folder. I would make a folder called |
Revision as of 15:12, 3 September 2007
Hello world in C#
- open a text editor (I like to use SCiTE)
- type in
- <csharp>
//HelloWorld in c# // //by Jeff Meyers jeff@iam.colum.edu
using System; namespace HelloClass {
class HelloWorld { public static void Main() { Console.WriteLine("Hello World!"); } }
}</csharp>
3 Save the file as HelloWorld.cs
4 Coplile the .cs file using csc or mcs
5 Use csc (windows) or mcs (*nix) ro compile
- csc run the HelloWorld.exe created by csc
- If you are using SCiTE and your path enviroment variables for csc are setup correctlty you can just press
- use mono to run the HelloWorld.exe created by mcs
mono HelloWorld.exe
6 Post to your oop folder. I would make a folder called