zoukankan      html  css  js  c++  java
  • 切莫忘记try catch

    interFaceMessagePost msg = (interFaceMessagePost)list[i];
                        string url =msg.UrlPost +"?"+msg.UrlParameter;
                        URL=url;
                        ForderFormId=msg.ForderformID;

                        //新的编码之后的url
                        string _tempExpesion="";
                        //发出票成功消息
                        Regex ticket=new Regex("tickets=(.*)");
                        bool isHaveTicket=ticket.Match(url).Success;
                        if(isHaveTicket)
                        {
                            if(ticket.Match(url).Groups!=null && ticket.Match(url).Groups.Count>0)
                            {
                                _tempExpesion=ticket.Match(url).Groups[1].Value;
                                url=url.Replace(_tempExpesion,System.Web.HttpUtility.UrlEncode(_tempExpesion));
                            }
                        }
                        else
                        {

                            Regex refundDetail=new Regex("RefundDeatils=(.*)");
                            bool isHaveRefund=refundDetail.Match(url).Success;
                            if(isHaveRefund)
                            {
                                if(refundDetail.Match(url).Groups!=null && refundDetail.Match(url).Groups.Count>0)
                                {
                                    _tempExpesion=refundDetail.Match(url).Groups[1].Value;
                                    url=url.Replace(_tempExpesion,System.Web.HttpUtility.UrlEncode(_tempExpesion));
                                }
                            }
                        }

    没有加try catch导致出错之后程序卡死

  • 相关阅读:
    access生成sql脚本,通过VBA调用ADOX
    virtualbox 使用USB引导启动安装系统
    atom 调用g++编译cpp文件
    VPython 三维显示 —— hello word
    sql高级篇(一)
    sql基础篇
    struts2中的<s:select>默认选项
    关于SVN更新注意
    mysql中的substr()函数
    mysql中exists的用法介绍
  • 原文地址:https://www.cnblogs.com/bangejingting/p/2595289.html
Copyright © 2011-2022 走看看