Exemplo n.º 1
0
        //-----------------------------------------------------
        public void SetConnexionProperty(string strProperty, string strValeur)
        {
            string strUpper = strProperty.ToUpper();

            if (m_interrogateur == null)
            {
                m_interrogateur = new CInterrogateurSnmpSimplePourFiller();
            }
            if (strUpper == c_parametreSnmpIp.ToUpper())
            {
                m_interrogateur.ConnexionIp = strValeur;
            }
            else if (strUpper == c_parametrePort.ToUpper())
            {
                try
                {
                    int nVal = Int32.Parse(strValeur);
                    m_interrogateur.ConnexionPort = nVal;
                }
                catch { }
            }
            else if (strUpper == c_parametreCommunaute.ToUpper())
            {
                m_interrogateur.ConnexionCommunity = strValeur;
            }
            else if (strUpper == c_parametreVersion.ToUpper())
            {
                try
                {
                    int nVal = Int32.Parse(strValeur);
                    m_interrogateur.SnmpVersion = nVal;
                }
                catch { }
            }
        }
Exemplo n.º 2
0
        //-----------------------------------------------------
        public string GetConnexionProperty(string strProperty)
        {
            string strUpper = strProperty.ToUpper();

            if (m_interrogateur == null)
            {
                m_interrogateur = new CInterrogateurSnmpSimplePourFiller();
            }
            if (strUpper == c_parametreSnmpIp.ToUpper())
            {
                return(m_interrogateur.ConnexionIp);
            }
            else if (strUpper == c_parametrePort.ToUpper())
            {
                return(m_interrogateur.ConnexionPort.ToString());
            }
            else if (strUpper == c_parametreCommunaute.ToUpper())
            {
                return(m_interrogateur.ConnexionCommunity);
            }
            else if (strUpper == c_parametreVersion.ToUpper())
            {
                return(m_interrogateur.SnmpVersion.ToString());
            }
            return("");
        }
Exemplo n.º 3
0
 //----------------------------------
 private void SetupConnexion()
 {
     foreach (CEasyQuerySource source in m_query.Sources)
     {
         CSnmpConnexionForEasyQuery snmpFiller = source.Connexion as CSnmpConnexionForEasyQuery;
         if (snmpFiller != null)
         {
             CInterrogateurSnmpSimplePourFiller agent = snmpFiller.Agent;
             if (agent != null)
             {
                 CSnmpConnexion cnx = agent.Connexion;
                 if (cnx == null)
                 {
                     cnx = new CSnmpConnexion();
                 }
                 if (CFormSetupInterrogationSNMP.EditeConnexion(ref cnx))
                 {
                     agent.Connexion = cnx;
                 }
                 break;
             }
         }
     }
 }
Exemplo n.º 4
0
 //---------------------------------------
 public CSnmpConnexionForEasyQuery(CInterrogateurSnmpSimplePourFiller interrogateur)
 {
     m_interrogateur = interrogateur;
 }