📄 validator.cs
字号:
using System;
namespace Park.Common
{
/// <summary>
/// Validator 的摘要说明。
/// </summary>
public class Validator
{
public static bool Validate(string y,string m,string d,out DateTime time)
{
time = new DateTime(1900,1,1);
int year ,month , day ;
if (y == null||y.Equals("")) return false;
if (m == null||m.Equals("")) return false;
if (d == null||d.Equals("")) return false;
try
{
year = int.Parse(y);
month = int.Parse(m);
day = int.Parse(d);
time = new DateTime(year,month,day);
}
catch(Exception)
{
return false;
}
return true;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -