2012年2月17日

摘要: 文章来源:http://www.javawind.net/5b016f382218328f0122e9d65ae41c9e.jhtml一、cookie机制和session机制的区别 具体来说cookie机制采用的是在客户端保持状态的方案,而session机制采用的是在服务器端保持状态的方案。 同时我们也看到,由于在服务器端保持状态的方案在客户端也需要保存一个标识,所以session机制可能需要借助于cookie机制来达到保存标识的目的,但实际上还有其他选择。二、会话cookie和持久cookie的区别 如果不设置过期时间,则表示这个cookie生命周期为浏览器会话期间,只要关闭浏览... 阅读全文
posted @ 2012-02-17 13:20 xupeng 阅读(376) 评论(0) 推荐(0) 编辑

2012年2月15日

摘要: #region 用户自定义变量 private static readonly Cache _cache;//缓存实例 private static readonly int hourfactor; #endregion #region 构造函数 static SetCache() { hourfactor = 3600; _cache = HttpRuntime.Cache; } private SetCache() { } #endregion #region 清除所有缓存 /// <summary> /// 清除所有缓存 /// </summary> public 阅读全文
posted @ 2012-02-15 14:27 xupeng 阅读(195) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 从1到33中任意选取不重复的6个随机数 /// </summary> /// <returns></returns> public List<int> GenerateNumber2() { //用于存放1到33这33个数 List<int> container = new List<int>(7); //用于保存返回结果 List<int> result = new List<int>(6); Random random = new Random() 阅读全文
posted @ 2012-02-15 14:25 xupeng 阅读(121) 评论(0) 推荐(0) 编辑
摘要: i = 5print (i)i = i + 1print (i)s = "This is the first sentence.\This is the second sentence."print (s)print ('-------------------')length = 5breadth = 2area = length * breadthprint ('Area is', area)print ('Perimeter is', 2 * (length + breadth))print ('--------- 阅读全文
posted @ 2012-02-15 11:53 xupeng 阅读(937) 评论(0) 推荐(0) 编辑
摘要: 批量替换MySQL指定字段中的字符串是数据库应用中很常见的需求,但是有很多初学者在遇到这种需求时,通常都是用脚本来实现;其实,MySQL内置的有批量替换语法,效率也会高很多批量替换的具体语法是:UPDATE 表名 SET指定字段 = replace(指定字段, ’要替换的字符串’, ’想要的字符串’)WHERE 条件;如果你想把 article 表中 ID 小于5000的记录,content 字段中“解决”替换成“解放”,那么语法就是:UPDATE article SETcontent = replace(content, ’解决’, ’解放’)WHERE ID<5000; 阅读全文
posted @ 2012-02-15 11:52 xupeng 阅读(200) 评论(0) 推荐(0) 编辑

2012年2月11日

摘要: 弄这个android天气预报的程序,出现了数据无法显示的问题。首先想到的当然是调试了,可是在调试的过程中出现了 source not found的问题。 我在http://ishare.iask.sina.com.cn/f/17062088.html上下载了android src 然后放置到我的android安装目录C:\Android\android-sdk\下。点击Edit Source Lookup Path...的按钮,把这个jar包放进去就OK啦! 阅读全文
posted @ 2012-02-11 09:47 xupeng 阅读(1582) 评论(0) 推荐(0) 编辑

2011年12月2日

摘要: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>无标题页</title> <script src=".. 阅读全文
posted @ 2011-12-02 16:28 xupeng 阅读(649) 评论(0) 推荐(0) 编辑
摘要: 把你的listBox列表放到隐藏控件中,然后得到js处理的listBox列表后台是不能直接得到的 方法<%@ Page Language="C#" EnableEventValidation="false" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat=&quo 阅读全文
posted @ 2011-12-02 16:24 xupeng 阅读(415) 评论(0) 推荐(0) 编辑

导航