自写保存字符串或文件为asp.net缓存的类
using System;
using System.Text;
using System.Web;
using System.IO;
namespace Chsword {
/// <summary>
/// 成幻互联缓存类
/// 邹健 2007.5
/// </summary>
class Cache {
TimeSpan _TimeSpan;
/// <summary>
/// 构造函数。自动设置缓存为1小时20分。
/// </summary>
public Cache() {
_TimeSpan = new TimeSpan(0, 1, 20, 0, 0);
}
/// <summary>
/// 构造函数。手动设置缓存有效时间。
/// </summary>
/// <param name="ts">缓存有效时间</param>
public Cache(TimeSpan ts) {
_TimeSpan = ts;
}
/// <summary>
/// 检测缓存是否存在或为空。
/// </summary>
/// <param name="CacheName">缓存名称</param>
/// <returns>缓存存在则返回True,反�
相关文档:
2010-01-25 14:24
40条ASP.NET开发Tip
作者:麒麟 来源:博客园 发布时间:2010-01-21 13:16 阅读:287 次 原文链接 [收藏]
1、在compilation 下,请设置debug=false ,如下:
default Language="c#" debug="false">
2、请使用Server.Tran ......
第一:
private void Button1_Click( object sender, System.EventArgs e ) { Response.Redirect( Request.Url.ToString( ) ); } 第二:
private void Button2_Click( object sender, System.EventArgs e ) { Response.Write( " < script language=javascript>window.location.href=document.URL; < /script&g ......
在不支持Cookies的移动设备模拟器中无法正常进行表单验证,联想到昨天使用web.config设置cookieless属性时会在访问时会出现"Cannot use a leading .. to exit above the top directory"的异常,自然而然的我就想到了前一段时间困扰我很久的一个站点异常无法使用前导 .. 在顶级目录上退出(Cannot use a leading .. to exit abo ......
Internet 类
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Net;
using System.IO;
using System.Text.RegularExpressions;
using System.Threading;
namespace DownData
{
class internet
{
&nb ......
许久以前,写过一篇《asp.net页中动态加入样式表文件》,后来发现在使用时如果每页都写这么个函数真是很麻烦,于是自己写了一个Page的派生。将这个函数加了进去。
/**//// <summary>
/// 作者 邹健
/// ......