WmptWap/App_LocalResources/CacheUtils.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。


// catheutils.cs:缓存的工具类
// CopyRight (c) 2009-2016 WMPT Teconology. All Rights Reserved.
// 123@163.com.com
// 2010-03-05

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Caching;
using System.Text.RegularExpressions;

//缓存
//this codes copy from web
//add by zhengjianfeng 2010-01-12
using WMPT.Common;

public class CacheUtils
{
    // 字段
    private static readonly Cache _cache;
    public static readonly int DayFactor = 0x4380;
    private static int Factor = 5;
    public static readonly int HourFactor = 720;
    public static readonly int MinuteFactor = 12;
    public static readonly double SecondFactor = 0.2;

    // 方法
    static CacheUtils()
    {
        HttpContext current = HttpContext.Current;
        if (current != null)
        {
            _cache = current.Cache;
        }
        else
        {
            _cache = HttpRuntime.Cache;
        }
    }

    private CacheUtils()
    {
    }

    public static void Clear()
    {
        IDictionaryEnumerator enumerator = _cache.GetEnumerator();
        ArrayList list = new ArrayList();
        while (enumerator.MoveNext())
        {
            list.Add(enumerator.Key);
        }
        foreach (string str in list)
        {
            _cache.Remove(str);
        }
后面还有 106 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。