一个简单的c# web程序
发布网友
发布时间:2022-05-13 04:04
我来回答
共3个回答
热心网友
时间:2023-11-17 15:02
DateTime t1 = Convert.ToDateTime(TextBox7.Text.Trim());
DateTime t2 = Convert.ToDateTime(TextBox8.Text.Trim());
DateTime t3 = Convert.ToDateTime(TextBox9.Text.Trim());
DateTime t4 = Convert.ToDateTime(TextBox10.Text.Trim());
DateTime t5 = Convert.ToDateTime(TextBox11.Text.Trim());
DateTime now = DateTime.Now.Date;
TimeSpan ts1 = now - t1;
TimeSpan ts2 = now - t2;
TimeSpan ts3 = now - t3;
TimeSpan ts4 = now - t4;
TimeSpan ts5 = now - t5;
int age1 = ts1.Days / 365;
int age2 = ts2.Days / 365;
int age3 = ts3.Days / 365;
int age4 = ts4.Days / 365;
int age5 = ts5.Days / 365;
int []array={age1,age2,age3,age4,age5};
for(int i=0;i<5;i++)
for(int j=0;j<4-i;j++)
if (array[j] > array[j + 1])
{
int t = array[j];
array[j ] = array[j+1];
array[j+1] = t;
}
TextBox12.Text = Convert.ToString(array[0]);
TextBox13.Text = Convert.ToString(array[1]);
TextBox14.Text = Convert.ToString(array[2]);
TextBox15.Text = Convert.ToString(array[3]);
TextBox16.Text = Convert.ToString(array[4]);
热心网友
时间:2023-11-17 15:02
等我装完vs帮你整一个
热心网友
时间:2023-11-17 15:03
呵呵,页面部分很简单,主要是sql语句。
写个存储过程来处理排序。