title: How to extract data using Ical.Net?
body: <p>I have an ics file I want to read data out from. I downloaded Ical.Net using Nuget and I'm trying to figure out how to work with it. All I want to do is get the same info as I would get if I uploaded my ics file to this website: <a href="https://icsconvert.appspot.com/" rel="nofollow noreferrer">https://icsconvert.appspot.com/</a></p>
  
  <p>Which is, for each "event":</p>
  
  <ul>
  <li>Summary</li>
  <li>Description</li>
  <li>Start</li>
  <li>End</li>
  <li>Location</li>
  </ul>
  
  <p>But I don't understand how I can get that info out of the file. Here's what I have so far:</p>
  
  <pre><code>string filepath = @"C:\My\file\path\myIcs.ics";
  System.IO.StreamReader file = new System.IO.StreamReader(filepath);
  string content = file.ReadToEnd();
  file.Close();
  
  Ical.Net.Calendar calendar = Ical.Net.Calendar.Load(content);
  
  foreach (var c in calendar.RecurringItems)
  {
      // 1. Do something!
      // 2. ????
      // 3. Profit!
  }
  </code></pre>
  
  <p>Here's a sample file I got from <a href="https://gist.github.com/DeMarko/6142417" rel="nofollow noreferrer">here</a>:</p>
  
  <pre><code>BEGIN:VCALENDAR
  VERSION:2.0
  CALSCALE:GREGORIAN
  BEGIN:VEVENT
  SUMMARY:Access-A-Ride Pickup
  DTSTART;TZID=America/New_York:20130802T103400
  DTEND;TZID=America/New_York:20130802T110400
  LOCATION:1000 Broadway Ave.\, Brooklyn
  DESCRIPTION: Access-A-Ride trip to 900 Jay St.\, Brooklyn
  STATUS:CONFIRMED
  SEQUENCE:3
  BEGIN:VALARM
  TRIGGER:-PT10M
  DESCRIPTION:Pickup Reminder
  ACTION:DISPLAY
  END:VALARM
  END:VEVENT
  BEGIN:VEVENT
  SUMMARY:Access-A-Ride Pickup
  DTSTART;TZID=America/New_York:20130802T200000
  DTEND;TZID=America/New_York:20130802T203000
  LOCATION:900 Jay St.\, Brooklyn
  DESCRIPTION: Access-A-Ride trip to 1000 Broadway Ave.\, Brooklyn
  STATUS:CONFIRMED
  SEQUENCE:3
  BEGIN:VALARM
  TRIGGER:-PT10M
  DESCRIPTION:Pickup Reminder
  ACTION:DISPLAY
  END:VALARM
  END:VEVENT
  END:VCALENDAR
  </code></pre>
  
  <p>How can I get the data I want? I want to use the foreach to save that data into a custom list.</p>