private void MainForm_Shown(object sender, EventArgs e) { IIconExtractor extractor = IconExtractor.Default; ImageUploadWatcher watcher = new ImageUploadWatcher() { PathToWatch = Properties.Settings.Default.ImageUploadPool, }; Presenter p = new Presenter(this, watcher, extractor); p.Start(); }
private void OnConnectionFinished(object ex) { if (ex != null) { MessageBox.Show(this, "无法连接摄像头,请检查摄像头后重新连接", "连接错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { presenter.Start(); this.faceRecognize.Enabled = true; } }
private void StartCamera(Camera cam) { ICamera Icam = null; if (string.IsNullOrEmpty(Program.directory)) { SanyoNetCamera camera = new SanyoNetCamera(); camera.IPAddress = cam.IpAddress; camera.UserName = "******"; camera.Password = "******"; try { camera.Connect(); } catch (System.Net.Sockets.SocketException) { MessageBox.Show("无法连接摄像头,请检查摄像头后重新连接"); return; } catch (System.Net.WebException) { MessageBox.Show("无法连接摄像头,请检查摄像头后重新连接"); return; } Icam = camera; StartRecord(cam); Properties.Settings.Default.LastSelCamID = cam.ID; } else { MockCamera mc = new MockCamera(Program.directory); mc.Repeat = true; Icam = mc; } presenter = new Presenter(this, Icam); presenter.Start(); }
private void MainForm_Shown(object sender, EventArgs e) { IIconExtractor extractor = IconExtractor.Default; ImageUploadWatcher watcher = new ImageUploadWatcher() { PathToWatch = Properties.Settings.Default.ImageUploadPool, }; Presenter p = new Presenter(this, watcher, extractor); p.Start(); }
private void StartCamera(Camera cam) { ICamera Icam = null; if (string.IsNullOrEmpty(Program.directory)) { SanyoNetCamera camera = new SanyoNetCamera(); camera.IPAddress = cam.IpAddress; camera.UserName = "******"; camera.Password = "******"; try { camera.Connect(); } catch (System.Net.Sockets.SocketException) { MessageBox.Show("无法连接摄像头,请检查摄像头后重新连接"); return; } catch (System.Net.WebException) { MessageBox.Show("无法连接摄像头,请检查摄像头后重新连接"); return; } Icam = camera; StartRecord(cam); Properties.Settings.Default.LastSelCamID = cam.ID; } else { MockCamera mc = new MockCamera(Program.directory); mc.Repeat = true; Icam = mc; } presenter = new Presenter(this, Icam); presenter.Start(); }