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
    一个工具类的样子
  • 相关阅读:
    ios专题 - CocoaPods - 初次体验
    ios专题 - CocoaPods - 安装
    Objective-C浅拷贝和深拷贝
    支付宝交互流程
    UITabBar的隐藏
    iOS-容易造成循环引用的三种场景
    FMDB 的基本操作
    Swap file ".Podfile.swp" already exists!
    将UIImage保存成JPG或PNG格式存储在本地
    UI常用控件的一些属性
  • 原文地址:https://www.cnblogs.com/loning/p/1055374.html
Copyright © 2011-2022 走看看