Pages

Monday, December 2, 2013

Generating Random date and time




private void button1_Click(object sender, EventArgs e)
{
DateTime dt = new DateTime();
dt=DateTime.Now.AddDays(new Random().Next(1000));
MessageBox.Show(dt.ToString());

}

No comments:

Post a Comment