diff --git a/ICS/App.config b/ICS/App.config index 3832c97..dcef322 100644 --- a/ICS/App.config +++ b/ICS/App.config @@ -7,6 +7,7 @@ + diff --git a/ICS/App.config b/ICS/App.config index 3832c97..dcef322 100644 --- a/ICS/App.config +++ b/ICS/App.config @@ -7,6 +7,7 @@ + diff --git a/ICS/Form1.cs b/ICS/Form1.cs index 81cd949..50d2555 100644 --- a/ICS/Form1.cs +++ b/ICS/Form1.cs @@ -67,12 +67,17 @@ //threadFindWindow.Start(); // 初始化相机 - this.InitCameraDevice(); - - // 显示相机拍摄窗体并马上隐藏 - // 在ui主线程中可以实现,如果放在websocket线程中则打不开相机 - faceForm.Show(); - faceForm.Hide(); + if (ConfigHelper.GetAppConfig("useUSBCamera") == "true") + { + this.InitCameraDevice(); + + // 显示相机拍摄窗体并马上隐藏 + // 在ui主线程中可以实现,如果放在websocket线程中则打不开相机 + faceForm.Show(); + faceForm.Hide(); + + this.label_openCamera.Hide(); + } } public int init() @@ -969,7 +974,10 @@ private void button1_Click(object sender, EventArgs e) { label_initDev.Visible = true; - label_openCamera.Visible = true; + if (ConfigHelper.GetAppConfig("useUSBCamera") == "true") + { + label_openCamera.Visible = true; + } } } }