简体   繁体   English

Windows 移动 - 禁用 USB(紧凑框架 - C#)

[英]Windows Mobile - Disable USB (Compact Framework - C#)

I need to disable USB on Windows Mobile.我需要在 Windows Mobile 上禁用 USB。 How to disable USB on Windows Mobile using Compact Framework 2.0 (C#)?如何使用 Compact Framework 2.0 (C#) 在 Windows Mobile 上禁用 USB? I am using OpenNETCF too.我也在使用 OpenNETCF。 If it has some class to disable USB, I can use it too.如果它有一些 class 来禁用 USB,我也可以使用它。

A bit of advice, you have to implement both operations to lock / unlock the usb device.一点建议,您必须执行这两个操作来锁定/解锁 usb 设备。 Because if you can't unlock it you must perform a clean boot.因为如果您无法解锁它,您必须执行干净启动。

You should provision the device with this specific policies您应该使用此特定策略配置设备

<!-- DenyRAPI.xml !-->
<wap-provisioningdoc>
    <characteristic type="SecurityPolicy">
        <parm name="4097" value="0"/>
    </characteristic>
</wap-provisioningdoc>

<!-- AllowRAPI.xml !-->
<wap-provisioningdoc>
    <characteristic type="SecurityPolicy">
        <parm name="4097" value="2"/>
    </characteristic>
</wap-provisioningdoc>

I provide a link to the original post in which is suggested that you create the cabs.我提供了指向原始帖子的链接,其中建议您创建出租车。 Original Post 原帖

I have used another approach to read the XML configuration and then using the following method I execute the provisioning我使用另一种方法来读取 XML 配置,然后使用以下方法执行配置

Microsoft.WindowsMobile.Configuration.ConfigurationManager.ProcessConfiguration(XmlDocument,boolean);

Another option is to use builds the cabs and install them by using wceload.exe另一种选择是使用构建出租车并使用 wceload.exe 安装它们

If your application is code-signed and running in full trust, then you have access to protected registry keys.如果您的应用程序经过代码签名并以完全信任的方式运行,则您可以访问受保护的注册表项。 You could then try to edit or remove the various USB device driver configuration registry values.然后,您可以尝试编辑或删除各种 USB 设备驱动程序配置注册表值。 Then you might have disabled USB.那么你可能已经禁用了 USB。

Edit: Possibly involved registry keys:编辑:可能涉及的注册表项:

HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM