拔出&插入USB webCame

编程入门 行业动态 更新时间:2024-10-25 06:28:33
本文介绍了拔出&插入USB webCame的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 嗨 我正在尝试使用C#代码重置USB网络摄像头,我在Google上搜索了很多文章,但没有得到任何有用的解决方案 这是我的代码:

System.Management.ObjectQuery objectQuery = new System.Management.ObjectQuery("select * from CIM_LogicalDevice "); // search and get the list System.Management.ManagementObjectSearcher searcher = new System.Management.ManagementObjectSearcher(objectQuery); System.Management.ManagementObjectCollection list = searcher.Get(); // step through the list of devices label1.Text = list.Count.ToString(); foreach (System.Management.ManagementObject item in list) { listBox1.Items.Add(item.GetText(TextFormat.Mof)); if (item.GetPropertyValue("caption").ToString().Contains("USB PC Camera")) { item.InvokeMethod("Reset", null); } }

到达零件item.InvokeMethod("Reset", null); 时,总是会给我一个错误 它说:This method is not implemented in any class 请任何帮助 谢谢

解决方案

您必须使用..正确的WebCam Driver dll文件,并在项目中使用该dll ..并使用该dll的方法.

hi I''m trying to reset my USB web-came using c# code,and I googled a lot of articles but didn''t get any useful solution here''s my code:

System.Management.ObjectQuery objectQuery = new System.Management.ObjectQuery("select * from CIM_LogicalDevice "); // search and get the list System.Management.ManagementObjectSearcher searcher = new System.Management.ManagementObjectSearcher(objectQuery); System.Management.ManagementObjectCollection list = searcher.Get(); // step through the list of devices label1.Text = list.Count.ToString(); foreach (System.Management.ManagementObject item in list) { listBox1.Items.Add(item.GetText(TextFormat.Mof)); if (item.GetPropertyValue("caption").ToString().Contains("USB PC Camera")) { item.InvokeMethod("Reset", null); } }

it always give me an error when it get to the part item.InvokeMethod("Reset", null); it says: This method is not implemented in any class please any help thank you

解决方案

You Have to use .. Proper WebCam Driver dll file and use that dll in your project .. and consume that dll''s methods.

更多推荐

拔出&插入USB webCame

本文发布于:2023-11-05 04:05:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1559849.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:amp   USB   webCame

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!