Hi SAM,
If you mean learning C# there are plenty of resources on the internet.
Just do a search for 'C#' and 'Tutorial'.
Basically, you need to put everything inside a class
public class MyClass
{
}
And you need a starting point. The first method that runs is called Main
(capital M)
public class MyClass
{
public static void Main()
{
// this is a comment and will be ignored by the compiler
// put your code here
}
}
If you are creating a windows program you need to create a class that
inherits from System.Windows.Forms.Form
public class MyClass : System.Windows.Forms.Form
{
public static void Main()
{
}
}
And in your Main method you need to call Application.Run with the
constructor of your class as a parameter.
public class MyClass : System.Windows.Forms.Form
{
public MyClass()
{
// this is the class constructor
// You typically create buttons etc here
// note the lack of a return type
// ie it should NOT be 'public void MyClass()'
}
public static void Main()
{
System.Windows.Forms.Application.Run(new MyClass());
}
}
Download the help files for .Net framework from msdn.microsoft.com (SDK)
and use your favourite text program (notepad is fine) to create code.
Once a codefile is created use csc.exe (found in
%windir%/Microsoft.Net/Framework/v1.1.4322/csc.exe or any other v?.? if
you install another version).
csc mycode.cs
will create mycode.exe
Also, you can add using statements to save typing
using System.Windows.Forms;
public class MyClass : Form
{
public MyClass()
{
}
public static void Main()
{
Application.Run(new MyClass());
}
}
This should get you started. Feel free to post questions on this
newsgroup when you are stuck or just curious about something (preferably
C# related)
