Get the current day of the week to achieve this feature there are several ways, next will be listed 3 for your reference, interested you can not miss Ha, I hope the knowledge provided in this article is helpful to you
The first type:
string[] Day =New string[] {"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday" };stringWeek = Day[convert.toint32 (DateTime.Now.DayOfWeek.ToString ("D"))]. ToString (); Lbday.text= Week;
The second type:
The third type:
Public Static stringDT; Public Static stringWeek; DT=DateTime.Today.DayOfWeek.ToString (); Switch(DT) { Case "Monday": Week="Monday"; Break; Case "Tuesday": Week="Tuesday"; Break; Case "Wednesday": Week="Wednesday"; Break; Case "Thursday": Week="Thursday"; Break; Case "Friday": Week="Friday"; Break; Case "Saturday": Week="Saturday"; Break; Case "Sunday": Week="Sunday"; Break; } Lbday.text= Week;
C # Get the current day of the week three ways to implement (GO)