Exemplo n.º 1
0
        //获得在线摄像机
        public void GetLineCameras()
        {
            List <Camera> lineCam        = new List <Camera>();
            List <Camera> trueLineCamera = new List <Camera>();
            XDocument     camXMLDoc      = XDocument.Load(fileName);
            var           camsElements   = camXMLDoc.Root.Descendants("cam");

            foreach (XElement camElement in camsElements)
            {
                int id = int.Parse((string)camElement.Attribute("id"));
                lineCam.Add(new Camera()
                {
                    ID        = id,
                    IpAddress = camElement.Attribute("ip").Value,
                    Name      = camElement.Attribute("name").Value,
                    Mac       = camElement.Attribute("MAC").Value,
                });
            }

            CheckLiveCamera gs = new CheckLiveCamera(lineCam, this);

            thread = new Thread(new ParameterizedThreadStart(gs.Run));
            thread.IsBackground = true;
            thread.Start();
        }
Exemplo n.º 2
0
        //获得在线摄像机
        public void GetLineCameras()
        {
            List<Camera> lineCam = new List<Camera>();
            List<Camera> trueLineCamera = new List<Camera>();
            XDocument camXMLDoc = XDocument.Load(fileName);
            var camsElements = camXMLDoc.Root.Descendants("cam");

            foreach (XElement camElement in camsElements)
            {
                int id = int.Parse((string)camElement.Attribute("id"));
                lineCam.Add(new Camera()
                {
                    ID = id,
                    IpAddress = camElement.Attribute("ip").Value,
                    Name = camElement.Attribute("name").Value,

                });
            }

            CheckLiveCamera gs = new CheckLiveCamera(lineCam, this);
            thread = new Thread(new ParameterizedThreadStart(gs.Run));
            thread.IsBackground = true;
            //thread.Start();
        }