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导致出错之后程序卡死

  • 相关阅读:
    sharepoint custom web service
    网站模板创建报错
    sharepoint 2013 持续爬网
    使用 SQL的 for xml path来进行字符串拼接 (group by)
    sharepoint 修改AD密码
    SharePoint 2013 BCS
    系统补丁对sharepoint很重要
    SharePoint 2010: Export User Profile Properties to a Text File or Excel using PowerShell
    SharePoint2013 错误
    sharepoint 开发相关工具总结
  • 原文地址:https://www.cnblogs.com/bangejingting/p/2595289.html
Copyright © 2011-2022 走看看