Difference between revisions of "Helloworld in csharp"
esse quam videri
m (Text replacement - "<csharp>" to "<syntaxhighlight lang="csharp" line="1" >") |
m (Text replacement - "</csharp>" to "</syntaxhighlight>") |
||
Line 18: | Line 18: | ||
} | } | ||
} | } | ||
− | }</ | + | }</syntaxhighlight> |
3 Save the file as HelloWorld.cs<br /> | 3 Save the file as HelloWorld.cs<br /> | ||
4 Coplile the .cs file using [[csc]] or [[mcs]]<br /> | 4 Coplile the .cs file using [[csc]] or [[mcs]]<br /> |
Revision as of 18:29, 25 January 2016
Hello world in C#
- open a text editor (I like to use SCiTE)
- type in
1 //HelloWorld in c# 2 // 3 //by Jeff Meyers jeff@iam.colum.edu 4 5 using System; 6 namespace HelloClass 7 { 8 class HelloWorld 9 { 10 public static void Main() 11 { 12 Console.WriteLine("Hello World!"); 13 14 } 15 } 16 }
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 "Hw1". Then you should make a link to you file using the source browser like this
<a href="http://iam.colum.edu/oop/gbrowser.php?file=/ExampleStudentSite/oop/Hw1/HelloWorld.cs"> Home work One HelloWorld.cs </a>
Post this link on you oop page