|
通し番号も一緒に並び変えたらええですねー
using System;
using System.Collections;
public class Program {
public static void Main() {
DateTime operationTimeA = new DateTime(2008,2,1,15,0,0);
DateTime operationTimeB = new DateTime(2008,2,2,10,0,0);
DateTime operationTimeC = new DateTime(2008,2,1,8,0,0);
DateTime operationTimeD = new DateTime(2008,2,1,10,0,0);
DateTime operationTimeE = new DateTime(2008,2,2,8,0,0);
SortedList list = new SortedList();
list.Add(operationTimeA,0);
list.Add(operationTimeB,1);
list.Add(operationTimeC,2);
list.Add(operationTimeD,3);
list.Add(operationTimeE,4);
foreach ( DictionaryEntry de in list) {
Console.WriteLine("[{0}] {1}", de.Value, de.Key);
}
}
}
|