/ Published in: C#
Expand |
Embed | Plain Text
Response.AppendHeader("content-disposition", "attachment; filename=Calendar.vcs"); Response.ContentType = "text/x-vcalendar vcs"; Response.Charset = "utf-8"; Response.ContentEncoding = System.Text.Encoding.UTF8; Response.Write("BEGIN:VCALENDAR\n"); Response.Write("PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN\n"); Response.Write("VERSION:1.0\n"); Response.Write("BEGIN:VEVENT\n"); Response.Write("DTSTART:" + strStartDate + "\n"); Response.Write("DTEND:" + strEndDate + "\n"); Response.Write("LOCATION;ENCODING=QUOTED-PRINTABLE:" + strLocation + "\n"); Response.Write("TRANSP:1\n"); Response.Write("UID:040000008200E00074C5B7101A82E00800000000907848358ACDC5010000000000000000100000007E1B76A09767384396CC5B0B41C6B678\n"); Response.Write("SUMMARY;ENCODING=QUOTED-PRINTABLE:" + strSummary.Replace("'", "'") + " \n"); Response.Write("DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" + VCalClean(strDesc) + "\n"); Response.Write("END:VEVENT \n"); Response.Write("END:VCALENDAR \n"); Response.End(); private string VCalClean(string rawString) { string output = rawString; output = StripHTML(output); output = output.Replace("\r", ""); output = output.Replace("\n", ""); output = output.Replace("\t", ""); return output; }
Comments
Subscribe to comments
You need to login to post a comment.

Where is StripHTML defined?