zoukankan      html  css  js  c++  java
  • 几个常用判断



            
    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;

            }
  • 相关阅读:
    影响STA的因素-OCV
    FPGA的可靠性分析
    DFT
    Verilog 延时模型
    收缩数据库日志
    iis设置局域网访问,Context.Request.Url.Authority老是取出为localhost问题
    vs2012 后期生成事件命令报错 9009
    MIME配置
    sql 字符串拼接 =>for xml()
    js 切换embed的src值
  • 原文地址:https://www.cnblogs.com/Bruce_H21/p/877239.html
Copyright © 2011-2022 走看看