• 几个常用判断




            
    protected string AppPath(HttpRequest req)
            {
                
    string path = string.Empty;
                
    try
                {
                    path 
    = req.ApplicationPath != "/"
                        
    ? req.ApplicationPath + "/"
                        : req.ApplicationPath;

                }
                
    catch (Exception e)
                {
                    
    throw e;
                }
                
    return path;
            }





            
    protected string UrlPrefix(HttpRequest req)
            {
                
    string path = "http://"
                                
    + req.Url.Host.ToString();

                path 
    += req.ApplicationPath != "/"
                        
    ? req.ApplicationPath + "/"
                        : req.ApplicationPath;
                
    return path;
            }


    /*
             * <%# Eval("数据字段") %>  中Eval方法有两次重载
             *     Eval(string expression)  返回为object
             *     Eval(string expression,string format) 返回为string
             
    */
            
    public string GetLen(string str, int length)
            {
                
    if (str != null && str != string.Empty)
                    str 
    = str.Length > length
                        
    ? str.Substring(0, length) : str;
                
    else
                    str 
    = string.Empty;
                
    return str;

            }
  • 相关阅读:
    CoreOS 手动更新
    阿里云ECS安装 CoreOS
    CoreOS 手动升级篇
    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
    Microsoft.NETCore.App 版本不一致导致的运行失败
    设计模式之观察者模式
    设计模式之策略模式
    树的广度优先遍历和深度优先遍历(递归非递归、Java实现)
    设计模式之组合模式
    设计模式之外观模式
  • 原文地址:https://www.cnblogs.com/Bruce_H21/p/877239.html
Copyright © 2020-2023  润新知