Ok, well I don't have a true project just yet but I'll post some of my code that I've been toying around with in my first day of C#.
Class Data.cs
This class is creating two methods which perform different actions and take different amounts of parameters.
Code:
using System;
namespace Testing {
class Data {
public void Action(int age, string name) {
try {
System.Console.WriteLine(name + " is " + age + " years old." + "\n");
} catch (System.Exception e) {
System.Console.WriteLine("Error: " + e);
}
}
public void Information(string info) {
try {
System.Console.WriteLine(info);
} catch (System.Exception e) {
System.Console.WriteLine("Error: " + e);
}
}
}
}
Class Control.cs
This class is where the main is stored. It creates a reference to Class Data and calls its methods.
Code:
using System;
namespace Testing
{
public class Control
{
static void Main(string[] args)
{
Data d = new Data();
d.Action(19, "Chris");
d.Information("This would be from a TextBox in a WinForm.");
System.Console.ReadLine();
}
}
}