将 DateTime 数组加载到 ListBox 中?

发布于 2024-08-13 11:29:41 字数 67 浏览 15 评论 0原文

如何使用 DateTime 格式(仅包含时间)保存 Properties.Settings.Default.Array?

How can I save a Properties.Settings.Default.Array using DateTime format (with just the time)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

染墨丶若流云 2024-08-20 11:29:41

好的,我发现这个

添加设置,键入选择浏览并找到 System.Collection.ArrayList。

用于保存值

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();

用于检索值

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

请查看 使用C# 中的设置

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#

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文