• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Read Calendar

Reads iCalendar events from an .ics file.

Code

using DRIT.Mail.Rfc.ICal;

using var reader = new CalendarReader("calendar.ics");
Calendar calendar = reader.Read();

foreach (CalendarEvent evt in calendar.Events)
{
    Console.WriteLine($"Summary: {evt.Summary}");
    Console.WriteLine($"Start:   {evt.Start}");
    Console.WriteLine($"End:     {evt.End}");
    Console.WriteLine($"Location: {evt.Location}");
    Console.WriteLine();
}

Remarks

CalendarReader parses iCalendar data as defined in RFC 5545. A Calendar may contain events (VCALENDAR/VEVENT), to-do items (VTODO), journals (VJOURNAL), and free/busy blocks (VFREEBUSY).

  • Improve this Doc
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX