Windows Phone 7 - iCal 生成器 - C#
我需要根据从设备获取的约会生成 iCal 字符串。 Windows Phone 7 上是否有支持从约会生成 iCal 的库?
我尝试了 DDay.iCal,但它不适用于 Windows Phone 7。
I need to generate iCal string from appointments fetched from device. Is there any library that is supported on Windows Phone 7 to generate iCal from appointments?
I tried DDay.iCal, but it does not work with Windows Phone 7.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有遇到过专门针对 Windows Phone 7 的库,但编写自己的类来生成 iCal 文件应该不会太困难,因为毕竟 iCal 只是文本。 RFC 内容相当密集,但使用了一些在线参考喜欢这个并查看一些示例 iCal 文件应该足以开始。以 wikipedia 中的 iCal 文件为例:
因此请注意,您开始和结束 VCALENDAR,以及其中的 VEVENT,其中包含一些必填字段(如 UID)。唯一需要注意的是,规范要求将超过 75 个八位字节的行进行分解,因此您可以使用 此堆栈溢出中的方法对于长文本字段的问题:
该函数基本上转义所有必需的转义字符,并每 74 个字符插入一个换行符/空格。
祝你好运,玩得开心! :)
There isn't a library specific for Windows Phone 7 I've come across, but it shouldn't be too difficult to write your own classes to generate iCal files, since iCal is just text, after all. The RFC is quite a dense read, but using some online references like this one and looking at some example iCal files should be enough to get started. Take this example iCal file from wikipedia, for example:
So note you BEGIN and END a VCALENDAR, and a VEVENT within them, which has some required fields (like the UID). The only thing to note is that the specification requires lines longer than 75 octets to be broken up, so you can use this method from this stack overflow question for fields with long text:
The function basically escapes all required escape characters, and inserts a linefeed/space every 74 characters.
Good luck, have fun! :)