Click here to Skip to main content
15,867,488 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a calendar file(.ics) by using following code. i got this code by searching it in google.
C#
string[] contents = { "BEGIN:VCALENDAR",
            "PRODID:-//Flo Inc.//FloSoft//EN",
            "BEGIN:VEVENT",
            "DTSTART:" + schBeginDate.ToUniversalTime().ToString("yyyyMMdd\\THHmmss\\Z"), 
            "DTEND:" + schEndDate.ToUniversalTime().ToString("yyyyMMdd\\THHmmss\\Z"), 
            "LOCATION:" + strLocation, 
            "DESCRIPTION;ENCODING=ESCAPED-CHAR:" + strDesc,
            "SUMMARY:" + "SKS TASK: "+A.task_title, 
            "PRIORITY:3", 
            "END:VEVENT", 
            "END:VCALENDAR" 
            };
            System.IO.File.WriteAllLines("Here My File Path/calendar".ics", contents);

Now i want to add new events to this already created file. For Exaxple i have a calendar with one event, if i add second event it should add as a new event in that corresponding (.ics)file.
As a fresher i dont have knowledge that where to start for this task.
Please guide me with useful articles and Url.

What I have tried:

I have mentioned the code above. I tried to create new calendar file. Now want to add new event to that old file.
Posted
Updated 13-Oct-16 2:00am

1 solution

See File Methods (System.IO)[^]. You can use AppendAllLines.
 
Share this answer
 
Comments
Member 12727566 14-Oct-16 9:22am    
Thank you for the response. Let me try and tell you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900