Exemplo n.º 1
0
        public Dictionary <string, string> GetIp()
        {
            Dictionary <string, string> result = new Dictionary <string, string>();

            List <string> dpNames = dp.GetDpNamesByDPTName("_ConnectionDevices");

            for (int i = 1; i < dpNames.Count(); i++)
            {
                try
                {
                    result.Add(dpNames[i], dp.ReadDpValue(dpNames[i], "ip").ToString());
                }
                catch (Exception e)
                {
                    Console.WriteLine("Errors (Class WccIp function GetIp) " + e);
                }
            }
            return(result);
        }
Exemplo n.º 2
0
        public Dictionary <string, string> GetIp()
        {
            Dictionary <string, string> result = new Dictionary <string, string>();

            try
            {
                string startupPath = Assembly.GetExecutingAssembly().Location;
                startupPath  = startupPath.Substring(0, startupPath.Length - 18);
                startupPath += @"\config\config.ping";

                foreach (var value in File.ReadAllLines(startupPath))
                {
                    result.Add(value, dp.ReadDpValue(value, "ip").ToString());
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("Errors (class ConfigIp function GetIp) " + e);
                result = null;
            }
            return(result);
        }