我有一个应用程序可以在西类牙服务器上正常运行。
当我将应用程序上传到在线服务器(英文窗口)时,我收到异常(类型为“输入字符串不是有效的日期时间/Int32”)Convert.ToDateTime 和 Convert.ToInt32。是否有任何 web.config 行可以帮助我解决这个问题?我尝试在西类牙文化中添加全局化元素,但没有奏效。
你能帮我一下吗?
提前致谢。 何塞玛。
最佳答案
你需要:
System.Globalization.CultureInfo culture =
new System.Globalization.CultureInfo("es-ES");
DateTime myDateTime = Convert.ToDateTime(string, culture);
关于c# - asp.net 中 Convert.ToDateTime 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/680598/