Example #1
0
        public bool AddFirewallLogInfo(ref Entity.EntityFirewallLogInfo varInfo, string varCurrentFileSavePath, int varUseFileSign)
        {
            bool   backSign = false;
            string ErrorStr = String.Empty;

            try
            {
                ACDataNetFirewallLogInfo.HandleFilePathInfo = varCurrentFileSavePath;

                if (ACDataNetFirewallLogInfo.AddNetFirewallLogAllInfo(ref varInfo, varUseFileSign, ref ErrorStr))
                {
                    backSign = true;
                }

                if (ErrorStr.Trim() != String.Empty)
                {
                    throw new Exception(ErrorStr);
                }
                else
                {
                    return(backSign);
                }
            }
            catch (Exception ee)
            {
                throw new Exception(ee.Message);
            }
        }
Example #2
0
        public bool AddNetFirewallLogAllInfo(ref Entity.EntityFirewallLogInfo varEInfo, int varUseFileSign, ref string varErrorStr)
        {
            bool backSign = false;

            try
            {
                if (!GetXmlFilePathByUseFilePathKind(_FilePathInfo, varUseFileSign, ref sFilePathInfo, ref varErrorStr))
                {
                    return(backSign);
                }

                string[] sLInformationName = new string[13];
                sLInformationName[0]  = CCommon.Key_T_S_FirewallLog_FirewallLog_ID_Nvar;
                sLInformationName[1]  = CCommon.Key_T_S_FirewallLog_FirewallLog_Time_DateTime;
                sLInformationName[2]  = CCommon.Key_T_S_FirewallLog_Source_IPAddress_Nvar;
                sLInformationName[3]  = CCommon.Key_T_S_FirewallLog_Source_Port_Int;
                sLInformationName[4]  = CCommon.Key_T_S_FirewallLog_Destination_IPAddress_Nvar;
                sLInformationName[5]  = CCommon.Key_T_S_FirewallLog_Destination_Port_Int;
                sLInformationName[6]  = CCommon.Key_T_S_FirewallLog_FirewallRule_ID_Nvar;
                sLInformationName[7]  = CCommon.Key_T_A_NetProtocol_NetProtocol_ID_Nvar;
                sLInformationName[8]  = CCommon.Key_T_A_NetProtocol_NetProtocol_Name_Nvar;
                sLInformationName[9]  = CCommon.Key_T_S_FirewallLog_FirewallLogType_ID_Nvar;
                sLInformationName[10] = CCommon.Key_T_A_NetFirewallInModel_NetFirewall_ID_Nvar;
                sLInformationName[11] = CCommon.Key_T_A_NetFirewallInModel_NetFirewall_Name_Nvar;
                sLInformationName[12] = CCommon.Key_T_S_Uppermonitor_ControlParameters_IPAddress_Nvar;

                string[] sLInformationValue = new string[13];
                sLInformationValue[0]  = varEInfo.FirewallLog_ID;
                sLInformationValue[1]  = varEInfo.FirewallLog_Time.ToString("yyyy-MM-dd HH:mm:ss");
                sLInformationValue[2]  = varEInfo.Source_IPAddress;
                sLInformationValue[3]  = varEInfo.Source_Port.ToString();
                sLInformationValue[4]  = varEInfo.Destination_IPAddress;
                sLInformationValue[5]  = varEInfo.Destination_Port.ToString();
                sLInformationValue[6]  = varEInfo.FirewallRule_ID;
                sLInformationValue[7]  = varEInfo.NetProtocol_ID;
                sLInformationValue[8]  = varEInfo.NetProtocol_Name;
                sLInformationValue[9]  = varEInfo.FirewallLogType_ID;
                sLInformationValue[10] = varEInfo.NetFirewall_ID;
                sLInformationValue[11] = varEInfo.NetFirewall_Name;
                sLInformationValue[12] = varEInfo.NetFirewall_IPAddress;

                if (ACXDocumentControl.addSonNodeSingleElementAllInfo(sFilePathInfo, sRootNode,
                                                                      sNodeKeyName, "", sLInformationName, sLInformationValue, 0, 0, ref varErrorStr))
                {
                    backSign = true;
                }
            }
            catch (Exception ee)
            {
                throw new Exception(ee.Message);
            }

            return(backSign);
        }