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 运行


      

  • 相关阅读:
    09-JS的事件流的概念(重点)
    08-jQuery的位置信息
    07-小米导航案例
    python-selector模块
    python--day9--异步IO、数据库、队列、缓存
    python--select多路复用socket
    python--gevent高并发socket
    python--协程
    python--进程锁、进程池
    python--多进程
  • 原文地址:https://www.cnblogs.com/sarah-zhang/p/8287535.html
Copyright © 2011-2022 走看看