我做一个招标信息系统,我想实现信息过期时间,我加了一个字段:xx_gq_time;信息过期后在信息列表里信息标题就变灰色;
我在后台设置一个过期时间,比如格式为2008-8-8
代码如下:
System.Web.UI.WebControls.HyperLink hhh = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("H5");
System.Web.UI.WebControls.Label L2 = (System.Web.UI.WebControls.Label)e.Item.FindControl("Label2");
DateTime oldDate = new DateTime(L2.Text);
DateTime newDate = DateTime.Now;
if ( newDate > oldDate)
{
hhh.ForeColor=System.Drawing.Color.Gray;
}
else
{
hhh.ForeColor=System.Drawing.Color.Black;
}
=========================================
DateTime oldDate = new DateTime(L2.Text);
这句怎么写为好啊?
我在后台设置一个过期时间,比如格式为2008-8-8
代码如下:
System.Web.UI.WebControls.HyperLink hhh = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("H5");
System.Web.UI.WebControls.Label L2 = (System.Web.UI.WebControls.Label)e.Item.FindControl("Label2");
DateTime oldDate = new DateTime(L2.Text);
DateTime newDate = DateTime.Now;
if ( newDate > oldDate)
{
hhh.ForeColor=System.Drawing.Color.Gray;
}
else
{
hhh.ForeColor=System.Drawing.Color.Black;
}
=========================================
DateTime oldDate = new DateTime(L2.Text);
这句怎么写为好啊?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货