Thread: Post your C# programs/screenshots!

  1. #1
    Registered User CompiledMonkey's Avatar
    Join Date
    Feb 2002
    Location
    Richmond, VA
    Posts
    438

    Post your C# programs/screenshots!

    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.

  2. #2
    Registered User CompiledMonkey's Avatar
    Join Date
    Feb 2002
    Location
    Richmond, VA
    Posts
    438
    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();
    		}
    	}
    }

  3. #3
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    *g* sorry for not posting code, but my corporation wouldn't approve me posting their code... and it's not ready for screenshots yet ;-)
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  4. #4
    Registered User CompiledMonkey's Avatar
    Join Date
    Feb 2002
    Location
    Richmond, VA
    Posts
    438
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help (Trying to post message)
    By mrkm in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 10-06-2003, 04:05 PM
  2. Post your Best Text Adventure
    By Joe100 in forum Game Programming
    Replies: 3
    Last Post: 08-15-2003, 05:47 PM
  3. Auto POST
    By vasanth in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 06-07-2003, 10:42 AM
  4. post update
    By iain in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-12-2001, 10:47 AM