如何在单个变量中获取月,日和年 [英] how to get month,day and year in a single variable
本文介绍了如何在单个变量中获取月,日和年的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
用户输入的格式应为mm/dd/yyyy;
谢谢
Arun.
Hi ,
Input from the user should accept in the form mm/dd/yyyy;
Thanks
Arun.
推荐答案
使用 ^ ]变量.
对于输入,请使用DateTimePicker并设置 http://msdn.microsoft .com/en-us/library/system.windows.forms.datetimepicker.format.aspx [
Use a http://msdn.microsoft.com/en-us/library/aa326680(VS.71).aspx[^]varaible.
For the input use the DateTimePicker and set the http://msdn.microsoft.com/en-us/library/system.windows.forms.datetimepicker.format.aspx[^]property.
Other option could be to use a regular exression validator.
Web还是Windows?
在Windows应用程序中,只需使用MaskedEdit控件并将其"Mask"属性设置为"Short Date".
在Web应用程序中,只需阅读以下内容:
通过IE/Firefox中的MaskEdit限制输入 [
Web or Windows?
in windows application, simply use MaskedEdit Control and set its ''Mask'' Property to ''Short Date''.
in web application, just read this :
Restricting input by MaskEdit in IE / Firefox[^]
---------------------
Regards
H.Maadani
这篇关于如何在单个变量中获取月,日和年的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文