2013年5月8日 星期三

position: fixed work in IE6

add this code in the css:

_position: absolute; /* position fixed for IE6 */
_top:expression(documentElement.scrollTop);

2013年5月7日 星期二

2013年3月25日 星期一

完成下載時刪除檔案 Delete the file when finish download.


string responseFile = Server.MapPath("~/" + FileName);

try{
    Response.ContentType = "text/xml";
    Response.AppendHeader("Content-Disposition", "attachment; filename=" + FileName);
    Response.TransmitFile(responseFile);
    Response.Flush();
}
finally {
    File.Delete(responseFile);
}

2013年1月7日 星期一

Google url shortener

Google url shortener 可以生產出短網止,也可生產出QR code

Get the MD5 code


private string HashString(string Value)
    {
        System.Security.Cryptography.MD5CryptoServiceProvider x = new System.Security.Cryptography.MD5CryptoServiceProvider();
        byte[] data = System.Text.Encoding.ASCII.GetBytes(Value);
        data = x.ComputeHash(data);
        string ret = "";
        for (int i = 0; i < data.Length; i++)
            ret += data[i].ToString("x2").ToLower();
        return ret;
    }