Hi all,
I am trying to send .ics file as an attachment to user by creating ics file and email from C# code it self.I am able to send ICS file saving in to a local drive and attaching to email. I need start time and end time 24 hours format.
I created .ics file like this
String[] contents = { "BEGIN:VCALENDAR",
"PRODID:-//Flo Inc.//FloSoft//EN",
"BEGIN:VEVENT",
"DTSTART:" +DateTime.Now,
"DTEND:" + DateTime.Now,
"LOCATION:" + schLocation,
"DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" + emailContentVM.CalendarBody,
"SUMMARY:" + strSubjectText, "PRIORITY:3",
"END:VEVENT", "END:VCALENDAR" };
System.IO.File.WriteAllLines(System.Web.HttpContext.Current.Server.MapPath(@"~\Content\Images\CrewHub\TASAuth.ics"), contents);
emailContentVM.FileName = "TASAuth.ics";
emailContentVM.ContentType = " text/calendar; charset=utf-8";
string strContent = System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(@"~\Content\Images\CrewHub\TASAuth.ics"));
emailContentVM.Content = strContent;
string strEmailResponce = SendEmailWithCalendarAttachement(emailContentVM);
return strEmailResponce;
using above code am getting
start time : Tue 1/27/ 2015 5:30 Pm
End time: Tue 1/27/2015 6:30 pm
I need out put like this
start time : Tue 1/27/ 2015 5:30
End time: Tue 1/27/2015 6:30
i need time 24 hours format , plz kindly help me.
Thanks,
Ram