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
    一个工具类的样子
  • 相关阅读:
    C# 获取类似java gettime() 的时间格式
    LUbuntu电脑棒安装指南
    Visual Studio Gallery
    SQL SERVER 分页存储过程
    asp.mvc获取checkbox、radio、select的值
    C#面向对象的一些笔记
    Javascript预解析、作用域、作用域链
    解决ajax请求cors跨域问题
    Asp.Net操作WebServices
    2019年科技趋势前10位
  • 原文地址:https://www.cnblogs.com/loning/p/1055374.html
Copyright © 2011-2022 走看看