csharp create ICS file extension

 

                      string schLocation = "Conference Room 涂聚文约会你";
            string schSubject = "Business visit discussion约会";
            string schDescription = "Schedule description明天到深圳市福田區車公廟冶金大大廈約會";
            System.DateTime schBeginDate = Convert.ToDateTime("2/3/2012 10:00:00 PM");
            System.DateTime schEndDate = Convert.ToDateTime("2/3/2012 11:00:00 PM");

            String[] content = { "BEGIN:VCALENDAR",
                              "PRODID:-//Flo Inc.//FloSoft//EN",
                              "BEGIN:VEVENT",
                              "DTSTART:" + schBeginDate.ToUniversalTime().ToString("yyyyMMdd\\THHmmss\\Z"),
                              "DTEND:" + schEndDate.ToUniversalTime().ToString("yyyyMMdd\\THHmmss\\Z"),
                              "LOCATION:" + schLocation,
                                "PRIORITY:1",
                                 "SEQUENCE:0",
	                            "DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" + schDescription,
                              "SUMMARY:" + schSubject, "PRIORITY:3",
                            "SEQUENCE:0",
	                     "END:VEVENT", "END:VCALENDAR" };
            String [] contents1={"BEGIN:VCALENDAR",
                "PRODID:-//XYZ Corp//My Product//EN",
                "VERSION:2.0",
                "CALSCALE:GREGORIAN",
                "METHOD:PUBLISH",
                "X-WR-CALNAME:My Calendar",
                "X-WR-TIMEZONE:(GMT-05:00) Eastern Time (US & Canada)",
                "BEGIN:VEVENT",
                "DTSTART:20061021T100000Z",
                "DTEND:20061021T130000Z",
                "DTSTAMP:20090211T175526Z",
                "UID:5f98dfd5-ac72-4ae1-b3c2-799a4e7c91f9",
                "CLASS:PUBLIC",
                "CREATED:20071104T183833Z",
                "DESCRIPTION: My description text.",
                "LAST-MODIFIED:20071104T183833Z",
                "LOCATION:涂聚文约会你 地址:123 Anywhere Street\\; Anyplace, NJ 12345\\; US",
                "SEQUENCE:0",
                "STATUS:CONFIRMED",
                "SUMMARY: My summary text.",
                "TRANSP:OPAQUE",
                "END:VEVENT",
                "BEGIN:VEVENT",
                "DTSTART:20061101T170000Z",
                "DTEND:20061101T180000Z",
                "DTSTAMP:20090211T175526Z",
                "UID:6eaef015-eb90-4e94-8e6c-0003b928969a",
                "CLASS:PUBLIC",
                "CREATED:20071104T183833Z",
                "DESCRIPTION: My description for number 2.",
                "LAST-MODIFIED:20071104T183833Z",
                "LOCATION: 涂聚文约会你 地址:123 Anywhere Street\\; Anyplace, NJ 12345\\; US",
                "SEQUENCE:0",
                "STATUS:CONFIRMED",
                "SUMMARY: My summary for #2.",
                "TRANSP:OPAQUE",
                "END:VEVENT",
                "END:VCALENDAR"
            };

            String [] contents2={
                "BEGIN:VCALENDAR",
                "PRODID:-//XYZ Corp//My Product//EN",
                "VERSION:2.0",
                "CALSCALE:GREGORIAN",
                "METHOD:PUBLISH",
                "X-WR-CALNAME:My Calendar",
                "X-WR-TIMEZONE:(GMT-05:00) Eastern Time (US & Canada)",
                "BEGIN:VEVENT",
                "DTSTART:20061021T100000Z",
                "DTEND:20061021T130000Z",
                "DTSTAMP:20090211T175526Z",
                "UID:5f98dfd5-ac72-4ae1-b3c2-799a4e7c91f9",
                "CLASS:PUBLIC",
                "CREATED:20071104T183833Z",
                "DESCRIPTION: My description text.",
                "LAST-MODIFIED:20110721T105554Z",
            "LOCATION:涂聚文约会你",
            "SEQUENCE:0",
            "STATUS:CONFIRMED",
            "SUMMARY:Insert something",
            "TRANSP:OPAQUE",
            "BEGIN:VALARM",
            "ACTION:DISPLAY",
            "DESCRIPTION:This is an event reminder",
            "TRIGGER:-P0DT0H10M0S",
            "END:VALARM",
            "END:VEVENT",
            "BEGIN:VEVENT",
            "DTSTART:20110909T083000Z",
            "DTEND:20110909T103000Z",
            "DTSTAMP:20110722T004312Z",
            "UID:e5fhdjff6vakjftnl3l9vjs64k@google.com",
            "CREATED:20110721T105410Z",
            "DESCRIPTION:涂聚文明天到深圳市福田區車公廟冶金大廈約會",
            "LAST-MODIFIED:20110721T111008Z",
            "LOCATION:涂聚文约会",
            "SEQUENCE:1",
            "STATUS:CONFIRMED",
            "SUMMARY:Insert something",
            "TRANSP:OPAQUE",
            "BEGIN:VALARM",
            "ACTION:DISPLAY",
            "DESCRIPTION:Insert something",
            "TRIGGER:-P0DT0H10M0S",
            "END:VALARM",
            "END:VEVENT",
            "END:VCALENDAR"
            };

             String [] contents3={"BEGIN:VCALENDAR",
                    "PRODID:-//Google Inc//Google Calendar 70.9054//EN",
                    "VERSION:2.0",
                    "CALSCALE:GREGORIAN",
                    "METHOD:PUBLISH",
                    "X-WR-CALNAME:涂聚文约会你",
                    "X-WR-TIMEZONE:Insert something",
                    "X-WR-CALDESC:",
                    "BEGIN:VEVENT",
                    "DTSTART:20110909T180000Z",
                    "DTEND:20110909T200000Z",
                    "DTSTAMP:20110722T004312Z",
                    "UID:et53m4on1ii70en7uuv1thjr58@google.com",
                    "CREATED:20110721T105553Z",
                    "DESCRIPTION:",
                    "LAST-MODIFIED:20110721T105554Z",
                    "LOCATION:涂聚文约会你",
                    "SEQUENCE:0",
                    "STATUS:CONFIRMED",
                    "SUMMARY:Insert something",
                    "TRANSP:OPAQUE",
                    "BEGIN:VALARM",
                    "ACTION:DISPLAY",
                    "DESCRIPTION:This is an event reminder",
                    "TRIGGER:-P0DT0H10M0S",
                    "END:VALARM",
                    "END:VEVENT",

                    "BEGIN:VEVENT",
                    "DTSTART:20110909T083000Z",
                    "DTEND:20110909T103000Z",
                    "DTSTAMP:20110722T004312Z",
                    "UID:e5fhdjff6vakjftnl3l9vjs64k@google.com",
                    "CREATED:20110721T105410Z",
                    "DESCRIPTION:",
                    "LAST-MODIFIED:20110721T111008Z",
                    "LOCATION:Auckland",
                    "SEQUENCE:1",
                    "STATUS:CONFIRMED",
                    "SUMMARY:涂聚文约会你",
                    "TRANSP:OPAQUE",
                    "BEGIN:VALARM",
                    "ACTION:DISPLAY",
                    "DESCRIPTION:Insert something",
                    "TRIGGER:-P0DT0H10M0S",
                    "END:VALARM",
                    "END:VEVENT",

                    "END:VCALENDAR"
             };

             String [] contents4={"BEGIN:VCALENDAR",
                "PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN",
                "VERSION:2.0",
                "METHOD:PUBLISH",
                "X-CALSTART:20100611T140000Z",
                "X-CALEND:20100711T201500Z",
                "X-WR-RELCALID:{0000002E-5A22-AA75-713B-5C3715764495}",
                "X-WR-CALNAME: World Cup Football Complete Match Schedule 2010 South Africa",
                "BEGIN:VEVENT",
                "CATEGORIES:World Cup Football Complete Match Schedule 2010 South Africa",
                "CLASS:PUBLIC",
                "CREATED:20100608T231102Z",
                "DESCRIPTION:Group A\nFollow MarkThisDate on Twitter   markthisdate",
                "DTEND:20100611T154500Z",
                "DTSTAMP:20100513T100200Z",
                "DTSTART:20100611T140000Z",
                "LAST-MODIFIED:20100608T231102Z",
                "LOCATION:涂聚文约会你",
                "PRIORITY:5",
                "SEQUENCE:0",
                "SUMMARY:涂聚文约会你 地址:涂聚文明天到深圳市福田區車公廟冶金大廈約會",
                "TRANSP:TRANSPARENT",
                "UID:005ef5a170ab453276aad021756e5fde@dusystem.com",
                "X-MICROSOFT-CDO-BUSYSTATUS:FREE",
                "X-MICROSOFT-CDO-IMPORTANCE:1",
                "END:VEVENT",
                "BEGIN:VEVENT",
                "CATEGORIES:涂聚文约会你 地址:涂聚文明天到深圳市福田區車公廟冶金大廈約會",
                "CLASS:PUBLIC",
                "CREATED:20100608T231102Z",
                "DESCRIPTION:天下为公",
                "DTEND:20100611T201500Z",
                "DTSTAMP:20100513T100200Z",
                "DTSTART:20100611T183000Z",
                "LAST-MODIFIED:20100608T231102Z",
                "LOCATION:Cape Town ",
                "PRIORITY:5",
                "SEQUENCE:0",
                 "SUMMARY:Uruguay - France",
                "TRANSP:TRANSPARENT",
                "UID:9660590c514358c5bceed9e75bed0222@dusystem.com",
                "X-MICROSOFT-CDO-BUSYSTATUS:FREE",
                "X-MICROSOFT-CDO-IMPORTANCE:1",
                "END:VEVENT",
                "BEGIN:VEVENT",
                "CATEGORIES:涂聚文约会你 地址:World Cup Football Complete Match Schedule 2010 South Africa",
                "CLASS:PUBLIC",
                "CREATED:20100608T231102Z",
                "DESCRIPTION:不作為的官都在步步高升",
                "DTEND:20100612T131500Z",
                "DTSTAMP:20100513T100200Z",
                "DTSTART:20100612T113000Z",
                "LAST-MODIFIED:20100608T231102Z",
                "LOCATION:不作為的官都在步步高升",
                "PRIORITY:5",
                "SEQUENCE:0",
                "SUMMARY:Korea Republic - Greece",
                "TRANSP:TRANSPARENT",
                "UID:5a9eaca2435fb52e1c95ddb786f82efa@dusystem.com",
                "X-MICROSOFT-CDO-BUSYSTATUS:FREE",
                "X-MICROSOFT-CDO-IMPORTANCE:1",
                "END:VEVENT",
                "END:VCALENDAR"
                };

           String [] contents5={"BEGIN:VCALENDAR",
                "PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN",
                "VERSION:2.0",
                "METHOD:PUBLISH",
                "X-MS-OLK-FORCEINSPECTOROPEN:TRUE",
                "BEGIN:VEVENT",
                "CLASS:PUBLIC",
                "CREATED:20120203T120222Z",
                "DESCRIPTION:Schedule description明天到深圳市福田區車公廟冶金大廈約會",
                "DTEND:20120203T150000Z",
                "DTSTAMP:20120203T120200Z",
                "DTSTART:20120203T140000Z",
                "LAST-MODIFIED:20120203T120222Z",
                "LOCATION:Conference Room 涂聚文约会你",
                "PRIORITY:1",//提醒时间
                "SEQUENCE:0",
                "SUMMARY:Business visit discussion约会",
                "TRANSP:OPAQUE",
                "UID:040000008200E00074C5B7101A82E00800000000B0D4B7BDAEE2CC01000000000000000010000000C05DF5EA2953C0499548F598C334C23C",
                "DESCRIPTION:X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2//EN"+
	                ">\n<HTML>\n<HEAD>\n<META NAME=Generator CONTENT=MS Exchange Server ve"+
	                "rsion 08.00.0681.000>\n<TITLE></TITLE>\n</HEAD>\n<BODY>\n<!-- Converted f"+
	                "rom text/plain format -->\n\n<P>Schedule description明天到深圳市福"+
	                "田區車公廟冶金大大廈約會\n</P>\n\n</BODY>\n</HTML>",
                "X-MICROSOFT-CDO-BUSYSTATUS:BUSY",
                "X-MICROSOFT-CDO-IMPORTANCE:2",
                "BEGIN:VALARM",
                "TRIGGER:-PT1440M",
                "ACTION:DISPLAY",
                "DESCRIPTION:Reminder",
                "END:VALARM",
                "END:VEVENT",
                "END:VCALENDAR"};
                                 System.IO.File.WriteAllLines(Server.MapPath("Sample2.ics"), content,System.Text.Encoding.UTF8);
            System.IO.File.WriteAllLines(Server.MapPath("Sample3.ics"), contents1, System.Text.Encoding.UTF8);
            System.IO.File.WriteAllLines(Server.MapPath("Sample4.ics"), contents2, System.Text.Encoding.UTF8);
            System.IO.File.WriteAllLines(Server.MapPath("Sample5.ics"), contents3, System.Text.Encoding.UTF8);
            System.IO.File.WriteAllLines(Server.MapPath("Sample6.ics"), contents4, System.Text.Encoding.UTF8);
            System.IO.File.WriteAllLines(Server.MapPath("Sample7.ics"), contents5, System.Text.Encoding.UTF8);
            //METHOD TO SEND EMAIL IS CALLED
            SendMail();
            //Thread t1 = new System.Threading.Thread(new ThreadStart(SendMail));
            //t1.Start();
时间: 2024-09-27 04:34:28

csharp create ICS file extension的相关文章

MySQL中can't create PID file: No such file or directory错误的解决方法

风信网(ithov.com)原创文章:安装mysql完成之后,启动mysql报以下错误信息 [root@localhost mysql]# /usr/local/mysql/bin/mysqld_safe & 131206 22:50:00 mysqld_safe Logging to '/var/log/mysqld.log'. 131206 22:50:00 mysqld_safe Starting mysqld daemon with databases from /data/mysql/

mysql:Can&#039;t start server: can&#039;t create PID file: No space left on device_Mysql

解决案例一: 今天公司服务器上所有的网站都出现问题,有的打开没有数据,有的直接是空白. 我的第一反应就是数据库挂了.打开远程,进了系统,service mysqld stop 失败.service mysqld start等了好大一会,提示Timeout error occurred trying to start MySQL Daemon 一开始以为是mysql用户问题,查询系统用户完全没有问题. 打开log日志一看,问题出现了Can't start server: can't create

mysql提示[Warning] Cant create test file xxx lower-test

我想,你一定是从seo/seo.html" target="_blank">搜索引擎搜索这个标题进来的!你一定是想改变mysql默认安装的数据目录! 你已经修改了my.cnf中的datadir的值 首先是查看数据库日志 mysqld started [Warning] Can't create test file xxx.lower-test [Warning] Can't create test file xxx.lower-test /usr/libexec/mys

How to create PFX file

--First, thanks my colleague Hanker's collection. How to create PFX file 打开Microsoft.NET Framework的SDK命令提示,详细操作步骤如下:   1.创建一个自己签署的X.509证书.cer和一个私钥文件.pvk,用到.NET自带的makecert工具,命令如下:  cd C:\Program Files\Microsoft Visual Studio 9.0\SmartDevices\SDK\SDKTo

玩英lol不定时出现failed to create dump file:&quot;(error 183)

玩英雄联盟游戏不定时出现failed to create dump file:"(error 183)报错,如图: 解决办法如下 1.看看是不是dump目录权限不足:(C:\Users\用户名\AppData\Local\Temp目录,需要先显示隐藏文件才能查看) 2.右键文件夹在弹出菜单点击"属性"然后找到"安全选"上面找到"编辑"点击,如下图所示: 3.然后我们设置所有权限,我们搜索everyone,然后点击"检查名称&q

[0815]SP2-0606: Cannot create SPOOL file

[20150815]SP2-0606: Cannot create SPOOL file.txt 我想spool 到文件,带后缀名sql. 在linux下: SCOTT@test> accept abc test SCOTT@test> spool &&abc\.sql --这样就可以实现.避免&&abc解析出错. 而在windows下: SCOTT@40> accept abc test SCOTT@40> spool &&abc\

Csharp: Create Excel Workbook or word from Template File using aspose.Word 14.5 and aspose.Cell 8.1

winform: /// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnGenWord_Click(object sender, EventArgs e) { Dictionary<string, string> d

Csharp: read excel file using Open XML SDK 2.5

/// <summary> /// /// </summary> public class SheetNameInfo { private int _sheetId; private string _sheetName; private string _rid; /// <summary> /// /// </summary> public int SheetID { get{return _sheetId;} set{_sheetId= value;} }

Csharp:The .dat File using BinaryReader and BinaryWriter Convert to DataTable

/// <summary> /// 添加 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e) { BinaryWriter binWriter = new BinaryWriter(F