private string GetWeekName(DayOfWeek week) { string weekName = ""; switch (week) { case DayOfWeek.Friday: weekName = "週五"; break; case DayOfWeek.Monday: weekName = "週一"; break; case DayOfWeek.Saturday: weekName = "週六"; break; case DayOfWeek.Sunday: weekName = "週日"; break; case DayOfWeek.Thursday: weekName = "週四"; break; case DayOfWeek.Tuesday: weekName = "週二"; break; case DayOfWeek.Wednesday: weekName = "週三"; break; default: break; } return weekName; }
使用方式:
GetWeekName(DateTime.Now.DayOfWeek),