Compilation on Windows
1: First configure the C:\Windows\Microsoft.NET\Framework\v3.5 to the path of the system environment variable.
2: Write C # code
demo1.txt
Using System;namespace helloworld{ class program { static void Main (string[] args) { Console.WriteLine ("Hello world!"); Console.readkey ();}}}
demo2.txt
Using system;using System.Windows.Forms; Static class classapp{ static void Main () { Application.Run (new Form ());} }
3: Then open CMD,CD to TXT file in the same directory as enter the following command
csc /out: demo1.exe demo1.txt
csc /out: demo2.exe demo2.txt
Linux compilation (ubuntu12.04 For example, I will do this)
1. Use the terminal, Ctrl+alt+t, or file system to search for terminal
2. View disk information df-h
3.http://download.mono-project.com/sources/mono/Selecting the Mono version
Example
Cd/downloads
wget http://download.mono-project.com/sources/mono/mono-3.0.6.tar.bz2//download
TAR-JXVF mono-3.0.6.tar.bz2//Decompression
CD mono-3.0.6//Enter directory
./configure--PREFIX=/USR Configuration Directory
Make//Compile
Make Install//install
1. Open the terminal and go to the appropriate directory
2.
mcs test.cs
Then there will be a test.exe in the catalogue.
Run mono Test.exe to run
Compilation of C #