Jūs esate

dictionary

C#. Object -> Dictionary -> Object

I have the fallowing situation. I have an object. I need to make a Dictionary, which contains all the properties (and it's values) of the object. Then send this Dictionary over the network.

C#. Int array vs. ArrayList vs. Dictionary

private static void TestIntArray() { int [] array = new int[1000]; for (int i = 0; i < 1000; i++) array[i] = i; } private static void TestArrayList() { ArrayList array = new ArrayList(); for (int i = 0; i < 1000; i++) array.Add(i); } // Code.... long start = DateTime.Now.Ticks; TestIntArray(); long end = DateTime.Now.Ticks; Console.WriteLine("Time with int array: {0}", end - start); long start2 = DateTime.Now.Ticks; TestArrayList(); long end2 = DateTime.Now.Ticks; Console.WriteLine("Time with ArrayList array: {0}", end2 - start2);
The result:
Time
Subscribe to dictionary