DateTime today = DateTime.Now.Date;
Appointment appointment1 = new Appointment();
appointment1.Subject = "Basketball";
appointment1.Location = "Basketball court";
appointment1.Start = new DateTime(today.Year, today.Month, today.Day, 19, 30, 0);
appointment1.End = new DateTime(today.Year, today.Month, today.Day, 20, 30, 0);
DateRecurrence dr = new DateRecurrence();
dr.Frequency = DateRecurrenceFrequency.Weekly;
dr.Count = 20;
appointment1.Recurrence = dr.ToICalendarString();