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
    一个工具类的样子
  • 相关阅读:
    Java数据库操作(MySQL与SQLserver)
    LeetCode 11. 盛最多水的容器
    LeetCode 10.正则表达式匹配
    LeetCode 9.回文数
    LeetCode 7. 整数反转
    LeetCode 6.Z 字形变换
    LeetCode 4.寻找两个正序数组的中位数
    LeetCode 3. 无重复字符的最长子串
    JOI2020遗迹
    线性规划对偶
  • 原文地址:https://www.cnblogs.com/loning/p/1055374.html
Copyright © 2011-2022 走看看