zoukankan      html  css  js  c++  java
  • 二)网站项目WebUtility,Petshop 源码分析

    namespace PetShop.Web
        class WebUtility
        这个类代码
    Code
     
            
    private const string REDIRECT_URL = "~/Search.aspx?keywords={0}";
            
    private const string CATEGORY_NAME_KEY = "category_name_{0}";
            
    private const string PRODUCT_NAME_KEY = "product_name_{0}";
            
    private static readonly bool enableCaching = bool.Parse(ConfigurationManager.AppSettings["EnableCaching"]);
    私有数据定义了一些字符串,以及是否开启缓存。
     public static string InputText(string text, int maxLength) 
    public static string CleanNonWord(string text)public static void SearchRedirect(string key) 
    处理字符,搜索重定向,为什么在这里定义呢?
    public static string GetCategoryName(string categoryId)
    public static string GetProductName(string productId)
    这个在这里定义,应用缓存,否则可以直接调用category.GetCategory
    一个工具类的样子
  • 相关阅读:
    with 上下文协议
    __del__
    描述符使用
    理解并发(Concurrency)和并行(Parallelism)
    理解ThreadLocal
    理解死锁的概念(实例)
    遇到的几种设计模式的应用
    面试题02
    操作 mysql练习14-16题
    mysql练习11-13题
  • 原文地址:https://www.cnblogs.com/loning/p/1055374.html
Copyright © 2011-2022 走看看