C# 获取当前星期几

private static string GetWeekName()
{
string weekName = "";
switch (DateTime.Now.DayOfWeek)
{
case DayOfWeek.Monday:
weekName = "周一";
break;
case DayOfWeek.Tuesday:
weekName = "周二";
break;
case DayOfWeek.Wednesday:
weekName = "周三";
break;
case DayOfWeek.Thursday:
weekName = "周四";
break;
case DayOfWeek.Friday:
weekName = "周五";
break;
case DayOfWeek.Saturday:
weekName = "周六";
break;
case DayOfWeek.Sunday:
weekName = "周日";
break;
}
return weekName;
}

C# 获取当前星期几

上一篇:C#文件夹和文件操作


下一篇:WPF 实现 从窗体外拖动一文件 显示文件的 路径(地址)