摘要: 打开VS,新建项目--ASP.NET Web应用程序在Global.asax里面Application_Start事件(网站启动时)添加如下代码,实现创建一个用户的DataTable来保存每个访问网站的用户的信息。 protected void Application_Start(object sender, EventArgs e) { #region OnlineUsers 创建一个DataTable来保存每个访问网站的用户的信息 try { DataTable userTable... 阅读全文
posted @ 2012-11-10 11:08 Devin0613 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 1、实现页面自动刷新把如下代码放倒<head>区域中<meta http-equiv="refresh" content="3" />,则页面会3秒自动刷新一次。2、页面自动跳转<meta http-equiv="refresh" content="3;url=http://www.baidu.com" />,则页面3秒自带跳到百度页面,如果是当前页面即为自动刷新了。3、setTimeout实现<body onload="setTimeout('histo 阅读全文
posted @ 2012-11-10 11:07 Devin0613 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 1、check.aspx.cs页面:protected void Page_Load(object sender, EventArgs e) { GraphicsImage(4); } private object[] CreateString(int strlength) { //定义一个数组存储汉子编码的组成元素 string[] str = new string[16] { "0", "1", "2", "3", "4", "5", "6", &qu 阅读全文
posted @ 2012-11-10 11:05 Devin0613 阅读(132) 评论(0) 推荐(0) 编辑
摘要: <div style="width:700px;height:2px; line-height:2px;background:#666;margin:0 auto;overflow:hidden;"></div>#underline{width:700px;height:2px;background:#666;margin:0 auto;}这样画的横线在火狐、IE8、9是没有问题的,但是在IE6上面像素却大大高于2px;甚至达到了10px。解决这个问题是在样式里面加句代码:overflow:hidden;这样就解决问题了。 阅读全文
posted @ 2012-11-10 11:04 Devin0613 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 将ViewState持久化保持在服务器端的代码,这样ViewState不占用网络带宽,因此其存取只是服务器的磁盘读取时间。并且它很小,可以说是磁盘随便转一圈就能同时读取好多ViewState,因此可以说“不占时间”。为了“不占磁盘时间”,还可以使用了缓存。 新建一个类,命名为ViewStateToDisk,继承Page类,代码如下:usingSystem;usingSystem.Collections.Generic;usingSystem.Web;usingSystem.Web.UI;usingSystem.IO;/// <summary>///ViewStateToDisk 的 阅读全文
posted @ 2012-11-10 11:02 Devin0613 阅读(162) 评论(0) 推荐(0) 编辑