开发者

Load a DateTime array into ListBox?

开发者 https://www.devze.com 2022-12-13 12:17 出处:网络
How can I save a Properties.Settings.Default开发者_JAVA百科.Array using DateTime format (with just the time)?OK, i found this

How can I save a Properties.Settings.Default开发者_JAVA百科.Array using DateTime format (with just the time)?


OK, i found this

Add a setting, type select browse and find System.Collection.ArrayList.

for saving the values

if (Properties.Settings.Default.test == null)
   Properties.Settings.Default.test = new System.Collections.ArrayList();
Properties.Settings.Default.test.Add(new DateTime(2009, 1, 1));
Properties.Settings.Default.Save();

for retrieveing the values

System.Collections.ArrayList list = Properties.Settings.Default.test;
for (int iDate = 0; iDate < list.Count; iDate++)
{
   DateTime dateValue = (DateTime)list[iDate];
}

Have a look at Using Settings in C#

0

精彩评论

暂无评论...
验证码 换一张
取 消