C#中,获取容器中所有控件
foreach (Control contr in this.palchangepassword.Controls)
{
contr.Visible = true;
}
C#中,获取容器中某种控件
foreach (Control con in this.Controls)
{
if (con.GetType() == typeof(Label))
{
con.Visible = false;
}
}
C#获取系统时间
DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString("D2") + DateTime.Now.Day.ToString("D2") + DateTime.Now.Hour.ToString("D2") + DateTime.Now.Minute.ToString("D2") + DateTime.Now.Second.ToString("D2");
==============================================
数据绑定
cboclass.ValueMember = "ID";
cboclass.DisplayMember = "ClassName";
cboclass.DataSource = dt;