Tuesday

dday ical example

         
// #1: Monthly meetings that occur on the last Wednesday from 6pm - 7pm

// Create an iCalendar
iCalendar iCal = new iCalendar();

// Create the event
Event evt = iCal.Create<Event>();
evt.Summary = "Test Event";
evt.Start = new iCalDateTime(2008, 1, 1, 18, 0, 0); // Starts January 1, 2008 @ 6:00 P.M.
evt.Duration = TimeSpan.FromHours(1);

// Add a recurrence pattern to the event
RecurrencePattern rp = new RecurrencePattern();
rp.Frequency = FrequencyType.Monthly;
rp.ByDay.Add(new DaySpecifier(DayOfWeek.Wednesday, FrequencyOccurrence.Last));
evt.AddRecurrencePattern(rp);

// #2: Yearly events like holidays that occur on the same day each year.
// The same as #1, except:
RecurrencePattern rp = new RecurrencePattern();
rp.Frequency = FrequencyType.Yearly;
evt.AddRecurrencePattern(rp);

// #3: Yearly events like holidays that occur on a specific day like the first monday.
// The same as #1, except:
RecurrencePattern rp = new RecurrencePattern();
rp.Frequency = FrequencyType.Yearly;
rp.ByMonth.Add(3);
rp.ByDay.Add(new DaySpecifier(DayOfWeek.Monday, FrequencyOccurrence.First));
evt.AddRecurrencePattern(rp);

/*
Note that all events occur on their start time, no matter their
recurrence pattern. So, for example, you could occur on the first Monday
of every month, but if your event is scheduled for a Friday (i.e.
evt.Start = new iCalDateTime(2008, 3, 7, 18, 0, 0)), then it will first
occur on that Friday, and then the first Monday of every month after
that.
*/

1 comment:

Vaibhav Shah said...

HI,
I want to import & export events from yahoo calendar using DDay.ICal.
Do you have any example of it ?

test smtp server with powershell

Send-MailMessage -SMTPServer smtp.domain.com -To [email protected] -From [email protected] -Subject "This is a test email" -Body ...