'dictionary'에 해당하는 글 1건

Dictionary<int, int> dicLaneTrackingInfo = new Dictionary<int, int>();

dicLaneTrackingInfo[1] = 1;
dicLaneTrackingInfo[2] = 2;
dicLaneTrackingInfo[3] = 3;
dicLaneTrackingInfo[4] = 3;
dicLaneTrackingInfo[5] = 3;

IEnumerable<KeyValuePair<int, int>> test =
    from A in dicLaneTrackingInfo
    where A.Value == 3
    select A;

int aaa = test.ToList().Count();

foreach (KeyValuePair<int, int> Item in test)
{
     string sItem = "Key : " + Item.Key.ToString() + " / Value : " + Item.Value.ToString();
}

앞으로 자주 볼 수 있기를...

            class Pet
            {
                public string Name { get; set; }
                public int Age { get; set; }
            }

            public static void OrderByEx1()
            {
                Pet[] pets = { new Pet { Name="Barley", Age=8 },
                               new Pet { Name="Boots", Age=4 },
                               new Pet { Name="Whiskers", Age=1 } };

                IEnumerable<Pet> query = pets.OrderBy(pet => pet.Age);

                foreach (Pet pet in query)
                {
                    Console.WriteLine("{0} - {1}", pet.Name, pet.Age);
                }
            }

order by 는 요로케...

'020. Prigraming > 01. C#' 카테고리의 다른 글

[C#] 프로세스가 살아있다.  (0) 2011.07.01
[C#] 2진수변환  (2) 2011.05.23
[C#] ASCII 변환 알아보자  (0) 2011.02.16
[C#] Ping Test  (0) 2010.10.17
[C#] String to Byte  (0) 2010.09.23

WRITTEN BY
테네시왈츠
항상 겸손하게 항상 새롭게 항상 진실하게

,