此程序是实例101的 劳烦帮我看看 提示错误是
DateAndTime. FirstDayOfWeek FirstWeekOfYear不存在
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.VisualBasic;
namespace WindowsFormsApplication32
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
textBox1.Text = DateTime.Now.ToString();
textBox2.Text = "2012-10-01 00:00:00";
textBox1.ReadOnly = true;
textBox2.ReadOnly = true;
this.timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
DateTime timeend = Convert.ToDateTime(textBox2.Text);//设置结束时间
textBox1.Text = DateTime.Now.ToString();//设置当前时间
string timeday = DateAndTime.DateDiff("d", DateTime.Now, timeend, FirstDayOfWeek.Sunday, FirstWeekOfYear.FirstFourDays).ToString();
this.label5.Text = timeday + "天";
}
}
} |