PDA

Click to See Complete Forum and Search --> : Compile from Command Line


StrangerInBeijing
Oct 10th, 2005, 02:06 AM
Strange how quickly I can forget simple stuff if I don't use it.

Been playing around writing some C# code in a text editor, and compile them from the command line. Just playing for the fun.

Anyhow, I forgot how to go about and compile something like this:
using System;
public class Time
{
// public methods
public void DisplayCurrentTime( )
{
Console.WriteLine("stub for DisplayCurrentTime");
}
// private variables
int Year;
int Month;
int Date;
int Hour;
int Minute;
int Second;
}
public class Tester
{
static void Main( )
{
Time t = new Time( );
t.DisplayCurrentTime( );
}
}

guess I should create another account for such silly questions making my name gats, but then, that is frown upon here on the forums. :p

Mike Hildner
Oct 10th, 2005, 09:04 AM
csc.exe is the C# compiler - also take a look at this gui tool to help with command line options - http://www.codeproject.com/csharp/csccmdlgen.asp

Mike