如何禁用特定的usb端口com2 c#64位
How to disable a specific usb port com2 c# 64 bit
我尝试使用禁用com端口
Microsoft.Win32.Registry.SetValue(
@"HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesUSBSTOR",
"Start",
4,
Microsoft.Win32.RegistryValueKind.DWord
);
//enable USB storage...
Microsoft.Win32.Registry.SetValue(
@"HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesUSBSTOR",
"Start",
3,
Microsoft.Win32.RegistryValueKind.DWord
);
但在64位pc 中不起作用
有没有其他解决方案可以在64位中禁用com端口?
Eugh。不要这样做。使用SetupDiSetClassInstallParams
或WMI+devcon
或除编辑注册表之外的任何其他功能!
但要使用注册表,您需要指定RegistryView.Registry64
,或清除项目属性中的Prefer 32位标志
相关文章:
- Qt Q串行端口未编程设备未关闭
- 如何在C++(VS2010)中设置超时读取USB端口?
- AWS IoT 开发工具包:通过 TCP 端口 443 使用 MQTT
- 在 linux c++ 中没有通过串行端口发送的数据
- 检查串行端口Linux中是否有传入数据(cbInQue for linux)
- 在不传输的情况下更改 Win32 中的串行端口波特率
- 如何将值写入 DIO 模块 AUTOSAR 中的端口?
- grpc 的 ServerBuilder::AddListeningPort() 总是返回 TCP 端口零
- 增强 ASIO 和串行端口异步读取
- 串行端口写入究竟如何从缓冲区实际写入数据?
- 为什么我的 arduino 按钮在 0 和 1 以外的端口上不起作用?
- 如何将参数这些串行端口传递到函数中
- 如何在 Windows 中通过 SSL 端口枚举域控制器
- 无法将套接字绑定到 IPv4 和 IPv6 中的端口
- 从 C/C++ 访问 Android 中的串行端口
- RtMidIn在发行版c++中找不到端口
- Qt两个串行端口发送和接收
- CreateProcess在退出后占用套接字端口(每个套接字地址只允许使用一次)
- 通过串行端口从GPS传感器读取
- 如何禁用特定的usb端口com2 c#64位