Comment les créer .ics fichier par programmation?

Comment puis-je créer un fichier icalendar avec un minimum de données, j'ai essayer de le faire ce qui suit, mais somethings mal, quand j'essaie d'importer dans mon agenda Google, il dit les Événements importés avec succès mais je ne peux pas voir ces sur mon calendrier

    strResult.Append("BEGIN:VCALENDAR" & vbCrLf)           

    strResult.Append("VERSION:2.0" & vbCrLf)

    strResult.Append("METHOD:PUBLISH" & vbCrLf)

    While rst1.Read
        strResult.Append("BEGIN:VEVENT" & vbCrLf)

        strResult.Append("DTSTART: " & CDate(getLeave_date_start(CStr(rst1.getInteger("inq_id")), g_dom_id)).ToUniversalTime().ToString("yyyyMMddTHHmmssZ") & vbCrLf)    

        strResult.Append("DTEND: " & CDate(getLeave_date_end(CStr(rst1.getInteger("inq_id")), g_dom_id)).ToUniversalTime().ToString("yyyyMMddTHHmmssZ") & vbCrLf)

        strResult.Append("SUMMARY: " & rst1.getString("inq_name") & vbCrLf)

        strResult.Append("UID: " & rst1.getInteger("inq_id") & vbCrLf)

        strResult.Append("CLASS:PUBLIC" & vbCrLf)

        strResult.Append("END:VEVENT" & vbCrLf)

    End While
    strResult.Append("END:VCALENDAR" & vbCrLf)

    WriteCalendar(strResult)

J'ai écrit une fonction WriteCalendar comme suit

Private Sub WriteCalendar(ByVal data As String)
    Dim response As HttpResponse = Page.Response
    response.Clear()
    response.Buffer = True
    response.ContentType = "text/calendar"
    response.ContentEncoding = Encoding.UTF8
    response.Charset = "utf-8"
    response.AddHeader("Content-Disposition", "attachment;filename=""" & "icalendarTest" & ".ics""")
    response.Write(data)
    response.[End]()
End Sub

J'ai télécharger le fichier et de voir mes événements, mais quand il s'agit de l'importer dans Google Agenda, il est dit 6 événements importés avec succès mais je ne peux pas les voir sur mon calendrier

La sortie icalendarTest.ics

BEGIN:VCALENDAR  
VERSION:2.0  
METHOD:PUBLISH  
BEGIN:VEVENT  
DTSTART: 20110107T060000Z  
DTEND: 20110109T080000Z  
SUMMARY: ayin yedisinden dokuzuna  
UID: 9  
CLASS:PUBLIC  
END:VEVENT  
BEGIN:VEVENT
DTSTART: 20110119T103000Z  
DTEND: 20110119T150000Z  
SUMMARY: tek gunluk ondokuz  
UID: 10  
CLASS:PUBLIC  
END:VEVENT  
BEGIN:VEVENT  
DTSTART: 20110213T080000Z  
DTEND: 20110213T160000Z  
SUMMARY: Mijn Event  
UID: 21  
CLASS:PUBLIC  
END:VEVENT  
BEGIN:VEVENT  
DTSTART: 20110301T083000Z  
DTEND: 20110302T110000Z  
SUMMARY: Mart kapidan baktirir  
UID: 26  
CLASS:PUBLIC  
END:VEVENT  
BEGIN:VEVENT  
DTSTART: 20110117T080000Z  
DTEND: 20110117T120000Z  
SUMMARY: Neyse bi oncesi olsun  
UID: 27  
CLASS:PUBLIC  
END:VEVENT  
BEGIN:VEVENT  
DTSTART: 20110121T130000Z  
DTEND: 20110121T180000Z  
SUMMARY: ocak 21i  
UID: 31  
CLASS:PUBLIC  
END:VEVENT  
END:VCALENDAR  
une remarque: UID doit être unique dans tout l'univers (en tenant compte de toutes les galaxies). un entier n'est pas un très bon choix pour ce
peut-être que la raison pour ne pas montrer ma événements?
J'ai fait une autre avec Guid comme UID mais même résultat, l'importation réussie mais pas d'événements à l'affiche sur le calendrier BEGIN:VCALENDAR VERSION:2.0 MÉTHODE:PUBLIER BEGIN:VEVENT DTSTART: 20110114T230000Z DTEND: 20110114T230000Z RÉSUMÉ: des vacances sur mesure UID: 01c09e35-0bf4-4765-8489-5a07b6f3e49e CLASSE:PUBLIC END:VEVENT BEGIN:VEVENT DTSTART: 20110429T220000Z DTEND: 20110506T220000Z RÉSUMÉ: Mei vakantie UID: bd3aa376-8743-4aaa-b486-c91f38aae540 CLASSE:PUBLIC END:VEVENT END:VCALENDAR

OriginalL'auteur wallace740 | 2011-02-08