zoukankan      html  css  js  c++  java
  • C#

    想在ubuntu 14.04 上开发C#, 能用的有Mono

    Mono is a runtime environment that can run .NET applications and that works on both Windows and Linux. It includes a C# compiler.

    1. install Mono with sudo apt-get install monodevelop

    As of Ubuntu 14.04, the executable for MonoDevelop will be found at:  /usr/bin/monodevelop

    2. 控制台 Hello World

    //hello.cs
    using
    System; public class HelloWorld { static public void Main () { Console.WriteLine ("Hello Mono World"); } }

    使用命令 mcs hello.cs 编译之后会产生一个hello.exe, 可以使用命令 mono hello.exe 运行,输出结果为: Hello Mono World

    3. Winforms Hello World

    // hello_win.cs
    using
    System; using System.Windows.Forms; public class HelloWorld : Form { static public void Main () { Application.Run (new HelloWorld ()); } public HelloWorld () { Text = "Hello Mono World"; } }

    使用命令 mcs hello.cs -pkg:dotnet 编译会报错,需要使用 mcs helloWinforms.cs -pkg:dotnet -lib:/usr/lib/mono/2.0 (我使用的是ubuntu14.04)

    使用命令 mono hello.exe 运行


      

  • 相关阅读:
    python之shutil模块
    python的os模块
    python的map函数
    Web基础知识
    Web基础知识 --- html中的meta元素有什么用?
    使用技巧 --- 与 FireFox 相关
    基础知识之WIN32 API
    资料索引
    基础知识之C++篇
    使用技巧 --- 与 Visual Studio 有关
  • 原文地址:https://www.cnblogs.com/sarah-zhang/p/8287535.html
Copyright © 2011-2022 走看看