[英]How can i get other devices ip connected to same network in Windows Phone 8
[英]How Can I Get Connected Media Devices in Windows
我将准备一个应用程序(图表),询问用户要使用哪个网络摄像机并从选定的网络摄像机获取流。 为此,我需要搜索并找到连接到计算机的网络摄像头,这是我的第一步。 第二步是从该网络摄像头获取流。 我怎样才能做到这一点?
您可以使用此代码-基于ManagementObjectSearcher
class
static List<USBDeviceInfo> GetUSBDevices()
{
List<USBDeviceInfo> devices = new List<USBDeviceInfo>();
ManagementObjectCollection collection;
using (var searcher = new ManagementObjectSearcher(@"Select * From Win32_USBHub"))
collection = searcher.Get();
foreach (var device in collection)
{
devices.Add(new USBDeviceInfo(
(string)device.GetPropertyValue("DeviceID"),
(string)device.GetPropertyValue("PNPDeviceID"),
(string)device.GetPropertyValue("Description")
));
}
collection.Dispose();
return devices;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.