本文介绍了错误C#'system.stackoverflowexception'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I have an  error "System.StackOverflowException"
 when I get all alarms from cameras devices, any help ??





我尝试过:





What I have tried:

switch (_iAlarmType)
            {
                case AlarmConstMsgType.ALARM_VCA_INFO:

                    sbAlarmMsg.Append("- VCA");
                    int iChannelNumber = 0;
                    int iretu = NVSSDK.NetClient_GetChannelNum(_ulLogonID, ref iChannelNumber);
                    int channelCamera = iChannelNumber;
                    int int_rule = 0;
                    int iBufSiz = 80;
                    m_lpbuf = new NVS_FILE_LPBUF();

                    int iRetx = NVSSDK.NetClient_VCAGetAlarmInfo(_ulLogonID, _iAlarmState, ref m_lpbuf, iBufSiz);

                  try {
                        Console.WriteLine("Loading received alerts : " + m_lpbuf.m_iRuleID , "MyAlarm_NOTIFY_V4" + " " + DateTime.Today.ToString());
                        ObjLog.LoggerWritter("Loading received alerts : " + m_lpbuf.m_iRuleID + "  MyAlarm_NOTIFY_V4" + " " + DateTime.Today.ToString());
                        ObjLog.LoggerWritter("Loading  Alerts Rules : {" + m_lpbuf.m_iRuleID + "} MyAlarm_NOTIFY_V4" + " " + str_VCARules.ToString());

 
                        int  AlarmSentChannel = channelCamera;
                        int AlarmSentCustCompanyID = CustomerID;
                        string  AlarmSentDateIng = Convert.ToString(DateTime.Today);
                        string AlarmSentDescription = GetiAlarmType(_iAlarmType) + " - " + sbAlarmMsg.ToString();
                        int AlarmSentEstado = _iAlarmState;
                        string AlarmSentIDE = Convert.ToString(m_lpbuf.m_iID);// IPCustomer; // cantidadtrips++;
                        string AlarmSentrctTarget = "";
                        string AlarmSentRuleDescrip = GetiAlarmType(_iAlarmType) + " - " +  sbAlarmMsg.ToString();
                        int AlarmSentRuleID =  m_lpbuf.m_iRuleID; 
                        int AlarmSentState = _iAlarmState;
                        int AlarmSentTargetDirection = 0;
                        int AlarmSentTargetID = Convert.ToInt32(_iAlarmState.ToString());
                        int AlarmSentTargetSpeed = 0;
                        int AlarmSentTargetType = _iAlarmType;
                        int AlarmSentventType = _iAlarmType;

                        try
                        {
                            
                            string needle = _ulLogonID.ToString();
                            foreach (Device foo in Lista)
                            {
                                if (foo.DeviceIDLogon == needle)
                                {
                                    AlarmSentIDE = foo.DeviceIP;
                                }
                            }
                        }catch (Exception ex){

                        }

                        
                        SendAlarmsToNextivaSWG( AlarmSentChannel,
                                                AlarmSentCustCompanyID,
                                                AlarmSentDateIng,
                                                AlarmSentDescription,
                                                AlarmSentEstado,
                                                AlarmSentIDE,
                                                AlarmSentrctTarget,
                                                AlarmSentRuleDescrip,
                                                AlarmSentRuleID,
                                                AlarmSentState,
                                                AlarmSentTargetDirection,
                                                AlarmSentTargetID,
                                                AlarmSentTargetSpeed,
                                                AlarmSentTargetType,
                                                AlarmSentventType);

                        ObjLog.LoggerWritter("Sending received alerts to WebService Server from Device : " + AlarmSentIDE);

                   } catch (Exception ex) {
                            Console.WriteLine("Error Remote Windows Service SWG : {0} ", "MyAlarm_NOTIFY_V4" + " " + DateTime.Today.ToString());
                   }

                    return;
                  
                    break;
                default:
                    sbAlarmMsg.Append("-" + _iAlarmType.ToString());
                    break;
            }

推荐答案


这篇关于错误C#'system.stackoverflowexception'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 19:56