码迷,mamicode.com
首页 > Windows程序 > 详细

C#的编译

时间:2015-08-25 16:08:00      阅读:233      评论:0      收藏:0      [点我收藏+]

标签:

Windows上的编译

1:先将C:\Windows\Microsoft.NET\Framework\v3.5配置到系统环境变量的path里。

2:写C#代码

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:然后再打开cmd,cd到txt文件所在目录下输入如下命令

csc /out: demo1.exe demo1.txt

csc /out: demo2.exe demo2.txt

Linux上的编译(ubuntu12.04为例子,我就会这个)

1.使用终端,ctrl+alt+T,或者文件系统中搜索terminal
2.查看磁盘信息df -h
3.http://download.mono-project.com/sources/mono/ 选择mono版本
例子
cd /downloads
wget http://download.mono-project.com/sources/mono/mono-3.0.6.tar.bz2 //下载
tar -jxvf mono-3.0.6.tar.bz2 //解压
cd mono-3.0.6 //进入目录
./configure --prefix=/usr 配置目录
make //编译
make install //安装

1.打开终端,进入相应目录

2.

mcs test.cs

之后目录上就会有一个test.exe

运行 mono test.exe 就可以运行

 技术分享

C#的编译

标签:

原文地址:http://www.cnblogs.com/RainbowInTheSky/p/4757294.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!