ics c# asp.net 预约邀请

ics c# asp.net appointment invite

我正在尝试使用 C# 创建 outlook 约会 ICS 文件 Asp.net。下面是我从互联网上获得的示例代码,但缺少主题和与会者。如何将其包含在代码中?例如会议主题是:"Finance meeting" 与会者是:Sam@mycompany.com、Andy@mycompany.com、Lisa@mycompany.com

public string MakeHourEvent(string subject, string location, DateTime date, string startTime, string endTime)
   {
string filePath = string.Empty;
string path = HttpContext.Current.Server.MapPath(@"\iCal\");
filePath = path + subject + ".ics";
writer = new StreamWriter(filePath);
writer.WriteLine("BEGIN:VCALENDAR");
writer.WriteLine("VERSION:2.0");
writer.WriteLine("PRODID:-//hacksw/handcal//NONSGML v1.0//EN");
writer.WriteLine("BEGIN:VEVENT");
string startDateTime = GetFormatedDate(date)+"T"+GetFormattedTime(startTime);
string endDateTime = GetFormatedDate(date) + "T" + GetFormattedTime(endTime);
writer.WriteLine("DTSTART:" + startDateTime);
writer.WriteLine("DTEND:" + endDateTime);
writer.WriteLine("SUMMARY:" + subject);
writer.WriteLine("LOCATION:" + location);
writer.WriteLine("END:VEVENT");
writer.WriteLine("END:VCALENDAR");
writer.Close();
return filePath;
}

主题在摘要:参数中。描述:用于"body".

使用 ATTENDEE 添加与会者:属性,即

参加者;CUTYPE=个人;角色=REQ-PARTICIPANT;RSVP=TRUE;CN="John Smith" ;X-NUM-GUESTS=0:邮寄地址:john.smith@domain.com