问题在asp.net Convert.ToDateTime

编程入门 行业动态 更新时间:2024-10-15 18:26:30
本文介绍了问题在asp Convert.ToDateTime的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有没有任何问题在西班牙服务器工作的应用程序。

I have an application that works without any problem in a spanish server.

当我上载应用到在线服务器(英文Windows),即时得到异常(类型输入字符串是不是有效的datetime /的Int32)与Convert.ToDateTime和Convert.ToInt32。是否有任何的web.config线,可以帮助我在这件事情?我尝试添加一个全球化的元素与西班牙的文化,但没有奏效。

When i uploaded the application into the online server (an english windows), im getting exceptions (of type "input string is not a valid Datetime/Int32") with Convert.ToDateTime and Convert.ToInt32. Are any web.config line that could help me in this matter? I tried adding a globalization element with the Spanish culture, but didnt worked.

您能帮我个忙吗?

在此先感谢。Josema。

Thanks in advance. Josema.

推荐答案

您需要:

System.Globalization.CultureInfo culture = new System.Globalization.CultureInfo("es-ES"); DateTime myDateTime = Convert.ToDateTime(string, culture);

更多推荐

问题在asp.net Convert.ToDateTime

本文发布于:2023-11-25 00:50:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627638.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:net   asp   ToDateTime   Convert

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!