首頁 > 軟體

Ubuntu Mono 執行 Helloworld

2020-06-16 17:34:51

Ubuntu Mono 執行 Helloworld

Install mono

執行下面程式碼授權註冊repo源並更新軟體列表:


sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF 

echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list 

sudo apt-get update 

Install mono:


sudo apt-get install mono-complete

helloworld

class HelloMono 
{ 
    public static void Main(string[ ] args) 
    {
         System.Console.WriteLine("Hello Mono"); 
    } 
}

編譯:

mcs hw.cs

執行:

mono hw.exe

IT145.com E-mail:sddin#qq.com