class Program
{
static void Main(string[] args)
{
var weekdays = new string[] { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };
var time = DateTime.Now;
Console.WriteLine(weekdays[(int)time.DayOfWeek]);
}
}
DateTime.Now.DayOfWeek
使用DayOfWeek
日期类型有个这个属性 DayOfWeek 你可以试下 具体运用 研究下、、、