摘要: 1. 数据控件绑定时格式化日期方法: <asp:BoundColumn DataField="AddTime" HeaderText="添加时间"DataFormatString="{0:yyyy-MM-dd HH:mm}></asp:BoundColumn> <asp:BoundField DataField="AddTime" HeaderText="添加时间" DataFormatString="{0:yyyy-MM-dd}"/> 2. 用Da 阅读全文
posted @ 2013-02-17 11:13 王者杂货铺 阅读(154) 评论(0) 推荐(0) 编辑
摘要: cookie里面不能写中文,是由于cookie先天的编码方式造成的。所以需要有一种中间编码来过渡。URLEncode是最好的选择。我们以asp.net为例,代码如下:设置Cookie时:HttpCookie cookie = new HttpCookie("name", System.Web.HttpContext.Current.Server.UrlEncode("雨林星空"));Response.Cookies.Add(cookie);读取Cookie时:if (Request.Cookies["name"] != null){ 阅读全文
posted @ 2013-02-17 11:09 王者杂货铺 阅读(425) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.IO;public partial class _Default : System.Web.UI.Page{protec 阅读全文
posted @ 2013-02-17 11:08 王者杂货铺 阅读(875) 评论(0) 推荐(0) 编辑