歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Mono和MonoDevelop在Ubuntu 10.04上新安裝方法

Mono和MonoDevelop在Ubuntu 10.04上新安裝方法

日期:2017/2/28 15:53:13   编辑:Linux教程

今天發現了一個較簡單的方法來安裝mono和monodevelop在linux上進行.NET開發。再次感受到mono強大的魅力

那就是通過badgerports來安裝,網址:http://babdgerports.org,一個專門負責Ubuntu上mono軟件包安裝的團隊做的

badgerports is an Ubuntu repository. In order to use it, you must add it to your Software Sources.

  1. Click on "System", "Administration", "Software Sources".

  2. Click on the "Other Software" tab.

  3. Click on "Add...", and enter the line:

    deb http://badgerports.org lucid main

  4. Click on "Add Source"

  5. Click on "Authentication", then on "Import Key File"

  6. Download this GPG key file, ID 0E1FAD0C, and select it in the "Import Key File" window

  7. Click on "Close", then "Reload" when the pop-up appears. You're all set!

From now on, whenever you try to install or update Mono-related packages on your system, you will be given the badgerports version for preference. You don't need to do anything more than update your system as usual to get started!

第一個mono程序,注意編碼的問題

using System;
using System.IO;
using System.Text;

namespace tetsmono
{
class MainClass
{
public static void Main (string[] args)
{
//創建一個文件流
//FileStream fs=new FileStream("/home/guoyuanwei/test",FileMode.Open,FileAccess.ReadWrite);
//創建一個文本寫對象 ,包裝文件流
//StreamWriter sw=new StreamWriter(fs,Encoding.Default);
StreamWriter sw=new StreamWriter("/home/guoyuanwei/test",true,Encoding.Default);
try
{
//寫入文本,默認加一個換行
sw.WriteLine("中華人民共和國");
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
finally
{
sw.Close();
//fs.Close();
}
}

public static void AddText(FileStream fs,string values)
{
byte[] info=new UTF8Encoding(true).GetBytes(values);
fs.Write(info,0,info.Length);
}

}
}

更多Ubuntu相關信息見Ubuntu 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=2

Copyright © Linux教程網 All Rights Reserved