//C# Debugging in Visual Studio Instrumenting Applications public class Example1 { public static void Main() { System.Threading.Thread thread1 = new System.Threading.Thread(Test); thread1.Name = "thread1"; System.Threading.Thread thread2 = new System.Threading.Thread(Test); thread2.Name = "thread2"; thread1.Start(1); thread2.Start(2); Console.ReadLine(); } public static void Test(int ID) { Console.WriteLine(("Test " + ID)); } } public class Example2 { public static void Main() { Console.WriteLine(this.Method1(10)); } public static void Method1(int value) { return (value * 2); } } public class Example3 { public static void Main() { string[] arguments = Environment.GetCommandLineArgs(); int value1 = this.arguments(1); int value2 = this.arguments(2); string operation = this.arguments(3); object _switch1 = operation; if (_switch1.Equals("/operation:sum")) { Console.WriteLine(((((value1 + " + ") + value2) + " = ") + (value1 + value2))); } else { if (_switch1.Equals("/operation:multiply")) { Console.WriteLine(((((value1 + " * ") + value2) + " = ") + (value1 * value2))); } else { Console.WriteLine("Unknown operation."); } } Console.ReadLine(); } } public class Counter { private int m_Value; public Counter(int value) { this.m_Value = value; } public virtual int Value { get { Value = this.m_Value; } } public virtual void Raise() { this.m_Value += new System.EventHandler(1); } } public class Example4 { public static void Main() { Counter counter1 = new Counter(5); ArrayList arrayList1 = new ArrayList(); arrayList1.Add(counter1); Console.ReadLine(); } } //Bezoek www.vbvoorbeelden.be voor meer C# voorbeelden. //Copyright - De Wolf / vbvoorbeelden - 2003-2011 - Alle rechten voorbehouden.