【问题标题】:WP7 DateTimeFormat null creating IndexOutOfRangeException on datesWP7 DateTimeFormat null 在日期上创建 IndexOutOfRangeException
【发布时间】:2012-06-07 13:09:56
【问题描述】:

我已经发布了一个类似的问题,但在这里我有一个稍微不同的问题。 WP7.1 应用中的情况:

CultureInfo = new CultureInfo("es");

如果文化信息设置为 es(es-ES 工作正常,但不能解决硬编码),则当前文化的 DateTimeFormat (Thread.CurrentThread.CurrentCulture.DateTimeFormat) 为 null(抛出 IndexOutOfRangeException)导致简单的 DateTime .ToString() 失败并出现同样的异常。

我需要让它工作。我可能从上面假设了一些错误,我希望我这样做。有人可以帮我让它工作吗,或者指点我一些 msdn 解释它不起作用?

谢谢, 迈克尔

【问题讨论】:

    标签: windows-phone-7 datetime currentculture


    【解决方案1】:

    我不相信 WP7.1 只支持文化代码的“es”。请参阅此链接: http://msdn.microsoft.com/en-us/library/hh202918%28v=VS.92%29.aspx

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-29
    • 1970-01-01
    • 1970-01-01
    • 2021-06-19
    • 2021-12-03
    • 1970-01-01
    相关资源
    最近更新 更多