I'm interested to see how far some of you guys have gotten in C# so far. Can you post your programs (zips are perfect) or at least some screenshots detailing the program's purpose? Thanks in advance. :)
Printable View
I'm interested to see how far some of you guys have gotten in C# so far. Can you post your programs (zips are perfect) or at least some screenshots detailing the program's purpose? Thanks in advance. :)
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.
Class Control.csCode: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);
}
}
}
}
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();
}
}
}
*g* sorry for not posting code, but my corporation wouldn't approve me posting their code... and it's not ready for screenshots yet ;-)
Yeah, I hear that man. I don't want to know what would happen to me if I posted some of my Java code from work. :eek: