验证字段日期要求

时间:2018-05-21 18:10:45

标签: c# asp.net

我想知道如何在这种情况下实现验证,我向用户触发消息,说明应该填充该字段?

try
{
    if (process == null)
        process = new Process ();   
    try
    {
        DateTime DateSep = DateTime.Parse (line.ItemArray [18] .ToString ());
        processInterested.DateSep = DateSep;
    }
    catch
    {
        logErro.Append ("The cell S" + (line ["index"]) + "must be filled witha date.");
        fileInvalidated = true;
    }
} 
catch (Exception error)
{
    fileInvalidated = true;
    logErro.Append (error.Message + "<br>");
}

0 个答案:

没有答案