Popular Posts
javax.net.ssl.SSLHandshakeException: Connection closed by peer in Android 5.0 Lollipop Recently, there is a error occurs when access website via ssl connection like below although it worked fine several days ago. // Enable SSL... android.intent.action.SCREEN_ON & android.intent.action.SCREEN_OFF First, I've tried create a receiver to receive screen on/off and register receiver on AndroidManifest.xml like below, but unfortunately ... LogonUser Function : impersonate a windows user // This sample demonstrates the use of the WindowsIdentity class to impersonate a user. // IMPORTANT NOTES:  // This sample can be run only ...
Blog Archive
Stats
Add a event to Outlook calendar dymatically
protected void btnAddEventToOutlook_Click(object sender, EventArgs e)
{
    Response.Clear();
    Response.AddHeader("content-disposition", string.Format("attachment;filename={0}.ics", HttpUtility.UrlEncode(EventName, Response.HeaderEncoding)));

    Response.Write(string.Format(@"BEGIN:VCALENDAR
METHOD:PUBLISH
PRODID:-//{0}//NONSGML iCalcreator 2.6//ZH_TW
VERSION:2.0
X-WR-CALNAME;LANGUAGE=zh_tw:有 {1} 筆相關活動
BEGIN:VEVENT
UID:{2}
DTSTAMP:{3:yyyyMMddTHHmmss}Z
DESCRIPTION;LANGUAGE=zh_tw:{4}
DTSTART;TZID=TAIWAN:{5:yyyyMMddTHHmmss}
DTEND;TZID=TAIWAN:{6:yyyyMMddTHHmmss}
LOCATION;LANGUAGE=zh_tw:{7}
SUMMARY;LANGUAGE=zh_tw:{8}
URL;VALUE=URI:{9}
END:VEVENT
END:VCALENDAR",
        Request.Url.Host,
        PlaceCount,
        Request.QueryString["oid"],
        DateTime.Now,
        Description,
        Convert.ToDateTime(FromDate),
        Convert.ToDateTime(ToDate),
        Location,
        EventName,
        Request.Url));
    Response.End();
}
about ics file