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;

            }
  • 相关阅读:
    dotnet core 3.0 linux 部署小贴士
    Akka.net 性能测试兼使用小技巧
    如何给小学生讲清楚ECC椭圆曲线加密
    Typescript骚操作,在TS里面直接插入HTML
    源自于NEO的KeyValue 数据库面世啦
    编译ROCKSDB总结
    Windows linux子系统 使用说明
    dotnetcore http服务器研究(二)性能分析
    dotnetcore Http服务器研究(一)
    使用信号量来 限制无边界池子与队列
  • 原文地址:https://www.cnblogs.com/Bruce_H21/p/877239.html
Copyright © 2011-2022 走看看