Today we found a simple method to install mono and monodevelop for. NET development on linux. Once again feel the strong charm of mono that is installed through badgerports, URL: http://babdgerports.org, a team dedicated to install mono software package on Ubuntu do badgerportsisanUbunturepository. Inordertouseit, yo
Today we found a simple method to install mono and monodevelop for. NET development on linux. Once again, I feel the charm of mono.
That is through badgerports to install, URL: http://babdgerports.org, a dedicated responsible for Ubuntu mono package installation team to do
BadgerportsIs an Ubuntu repository. In order to use it, you must add it to your Software Sources.
Click on "System", "Administration", "Software Sources ".
Click on the "Other Software" tab.
Click on "Add...", and enter the line:
deb http://badgerports.org lucid main
Click on "Add Source"
Click on "Authentication", then on "Import Key File"
Download this GPG key file, ID 0E1FAD0C, and select it in the "Import Key File" window
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 givenBadgerportsVersion for preference. You don't need to do anything more than update your system as usual to get started!
The first mono program, pay attention to the encoding problem
UsingSystem;
UsingSystem. IO;
UsingSystem. Text;
NamespaceTetsmono
{
ClassMainClass
{
Public Static VoidMain (String[] Args)
{
//Create a file stream
//FileStream fs = new FileStream ("/home/guoyuanwei/test", FileMode. Open, FileAccess. ReadWrite );
//Create a text writing object and wrap the file stream
//StreamWriter sw = new StreamWriter (fs, Encoding. Default );
StreamWriter sw =NewStreamWriter ("/Home/guoyuanwei/test",True, Encoding. Default );
Try
{
//Write text. A line feed is added by default.
Sw. WriteLine ("People's Republic of China");
}
Catch(Exception ex)
{
Console. WriteLine (ex. Message );
}
Finally
{
Sw. Close ();
//Fs. Close ();
}
}
Public Static VoidAddText (FileStream fs,StringValues)
{
Byte[] Info =NewUTF8Encoding (True). GetBytes (values );
Fs. Write (info,0, Info. Length );
}
}
}
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2