Compilación:
mcs-r:System.Drawing.dll -r:System.Windows.Forms.dll -r:/usr/lib/mono/4.5/Microsoft.VisualBasic.dll r-:System.Data.dll Principal.cs
Ejecución:
mono Principal.exe
*/
using System.Windows.Forms;
using Microsoft.VisualBasic;
using System;
public class Principal{
public static void Main(string[] args){
Principal.inputBox();
}
public static void inputBox(){
try{
string input = Microsoft.VisualBasic.Interaction.InputBox("Estas seguro?","Quieres eliminar Windows?", "No, no quiero", 0, 0);
Console.WriteLine("Tu respuesta fue: {0}",input);
System.Windows.Forms.MessageBox.Show("Tu respuesta fue: "+input);
}catch(Exception ex){
Console.Error.WriteLine("Error: ["+ex.Message+"]");
Environment.Exit(0);
}
}
}
Ejemplode uso de Windows Forms en C# (Mono)
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.