Password Protected Program
This code password protects a program and has an example of it by protecting an OpenGL window. It can be used for protecting simple functions or actions also.
AI
AI 요약: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
소스 코드
Upload
Upload
public static void CalendarSelectWeek(System.Web.UI.WebControls.Calendar myControl)
{
if (myControl.SelectedDates.Count == 1)
// the user has only selected the day, need to select the week that day is in
{
System.DateTime tmpDate = myControl.SelectedDate;
DayOfWeek myFirstDayOfWeek;
//if the first day of week for calendar control is default, then that's not a day so change it to monday
if (myControl.FirstDayOfWeek == System.Web.UI.WebControls.FirstDayOfWeek.Default)
{
myFirstDayOfWeek = (DayOfWeek) System.Web.UI.WebControls.FirstDayOfWeek.Monday;
}
else
{
myFirstDayOfWeek = (DayOfWeek) myControl.FirstDayOfWeek;
}
//loop back till we have the first day of the week
while (myFirstDayOfWeek != tmpDate.DayOfWeek)
{
tmpDate = tmpDate.AddDays(-1);
}
myControl.SelectedDates.Clear();
//go through the week adding it to the selected dates
for (int i = 0; i <= 6; i++)
{
myControl.SelectedDates.Add(tmpDate.AddDays(i));
}
}
}
원본 댓글 (3)
Wayback Machine에서 복구됨