Advertisement
Advertisement
| 06.25.2008 at 04:50AM PDT, ID: 23514066 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: |
<%@ Page Language="vb" ContentType="text/html"
ResponseEncoding="ISO-8859-1" Debug="False" trace="False"%>
<%@ import Namespace="System.IO" %>
<script runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
'PARAMETERS
Dim beginDate as Date = Request("Dato")
Dim endDate as Date = Request("Dato")
Dim myLocation as String = ""
Dim mySubject as String = Request("Subject"))
Dim myDescription as String = Request("body") & "æ ø å Æ Ø Å"
'INITIALIZATION
Dim mStream As new MemoryStream()
Dim writer As new StreamWriter(mStream)
writer.AutoFlush = true
'HEADER
writer.WriteLine("BEGIN:VCALENDAR")
writer.WriteLine("PRODID:-//Flo Inc.//FloSoft//EN")
writer.WriteLine("BEGIN:VEVENT")
'BODY
writer.WriteLine("DTSTART:" & _
beginDate.ToUniversalTime.ToString("yyyyMMdd\THHmmss\Z") )
writer.WriteLine("DTEND:" & _
endDate.ToUniversalTime.ToString("yyyyMMdd\THHmmss\Z") )
writer.WriteLine("LOCATION:" & myLocation)
writer.WriteLine("DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" & myDescription)
writer.WriteLine("SUMMARY:" & mySubject)
'FOOTER
writer.WriteLine("PRIORITY:3")
writer.WriteLine("END:VEVENT")
writer.WriteLine("END:VCALENDAR")
'MAKE IT DOWNLOADABLE
Response.Clear() 'clears the current output content from the buffer
Response.AppendHeader("Content-Disposition", _
"attachment; filename=Appointment.vcs")
Response.AppendHeader("Content-Length", mStream.Length.ToString())
Response.ContentType = "application/download"
Response.BinaryWrite(mStream.ToArray())
Response.End()
End Sub
</script>
|