using Cognex.VisionPro.FGGigE; using Cognex.VisionPro.FGGigE.Implementation.Internal; //关闭相机连接,防止程序报错 CogFrameGrabberGigEs cameras = new CogFrameGrabberGigEs(); try { foreach (CogFrameGrabberGigE item in cameras) { item.Disconnect(false); } } catch (Exception ex) { Log.WriteTxt(ex.Message); }