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
    一个工具类的样子
  • 相关阅读:
    在devc++中使用to_string
    死磕Spring之AOP篇
    死磕Spring之AOP篇
    service to hadoop01/hadoop01:8020 Datanode denied communication with namenode because the host is not in the include-list
    Hadoop和HBASE对应兼容版本
    Flink SQL CDC中如何定义watermark和计算列
    Scala函数详解
    HBase 底层原理详解
    流计算 Oceanus SQL 开发指南
    NLP(二十二):基于依存句法的关键词抽取算法
  • 原文地址:https://www.cnblogs.com/loning/p/1055374.html
Copyright © 2011-2022 走看看