简体   繁体   English

如何使用DMProcessConfigXML设置Windows Mobile设备?

[英]How do I use DMProcessConfigXML to provision my Windows Mobile device?

I want to create a C# program to provision Windows Mobile devices. 我想创建一个C#程序来配置Windows Mobile设备。 I have found MSDN documentation on a function called DMProcessConfigXML , but no instructions on how to use this function. 我在名为DMProcessConfigXML的函数上找到了MSDN文档,但是没有有关如何使用此函数的说明。

How can I use this function in my Windows Mobile app? 如何在Windows Mobile应用程序中使用此功能? I suspect it has something to do with using pinvoke. 我怀疑这与使用pinvoke有关。

Thanks, 谢谢,
Paul 保罗

From managed code, you can call ConfigurationManager.ProcessConfiguration found in the Microsoft.WindowsMobile.Configuration namespace. 从托管代码中,可以调用Microsoft.WindowsMo​​bile.Configuration命名空间中的ConfigurationManager.ProcessConfiguration。 msdn Here is sample code: msdn这是示例代码:

XmlDocument configDoc = new XmlDocument();
configDoc.LoadXml(
    "<wap-provisioningdoc>"+
    "<characteristic type=\"BrowserFavorite\">"+
    "<characteristic type=\"Microsoft\">"+
    "<parm name=\"URL\" value=\"http://www.microsoft.com\"/>"+
    "</characteristic>"+
    "</characteristic>"+
    "</wap-provisioningdoc>"
    );
ConfigurationManager.ProcessConfiguration(configDoc, false);

No need to P/Invoke. 无需P /调用。

I looked at the MSDN and indeed very little information is available. 我查看了MSDN,实际上几乎没有可用的信息。 I did some google searching and I found this example . 我做了一些谷歌搜索,我发现了这个例子 Also this blog entry about a CF open source provisioning application. 也是有关CF开源供应应用程序的博客条目

Most of the available examples are in C++. 大多数可用示例都在C ++中。 If you want to call it from C#, you need to use pinvoke. 如果要从C#调用它,则需要使用pinvoke。 One great resource is pinvoke.net . 一个很好的资源是pinvoke.net Here you can find the signatures you need. 在这里您可以找到所需的签名。

The answers for what to send to DMProcessConfigXML are in MSDN but they are not very easy to understand. 关于发送到DMProcessConfigXML的内容的答案在MSDN中,但是它们不是很容易理解。 You need to look into the Configuration Service Providers documentation. 您需要查看Configuration Service Providers文档。

Basically you give it XML that will either query or set some sort of system parameter and it returns you XML as the result. 基本上,您给它提供XML,该XML将查询或设置某种系统参数,并且它将XML作为结果返回。 There is service providers for almost everything on the device. 几乎所有设备上都有服务提供商。 You have to be specific about what you want then I can point you in the documentation and samples that you want. 您必须具体说明所需的内容,然后我才能为您提供所需的文档和样本。

For example you can use it to query a registry value 例如,您可以使用它来查询注册表值

You give it the XML: 您给它XML:

<wap-provisioningdoc>
   <characteristic type="Registry">
      <characteristic type="HKCU\ControlPanel\Home">
         <parm-query name="Timeout"/>
      </characteristic>
   </characteristic>
</wap-provisioningdoc>

The result XML should look something like: 结果XML应该类似于:

<wap-provisioningdoc>
   <characteristic type="Registry">
      <characteristic type="HKCU\ControlPanel\Home">
         <parm name="Timeout" value="10000"/>
      </characteristic>
   </characteristic>
</wap-provisioningdoc>

That's a simple example, you can do lots of other things like setting up network settings, setting up mail accounts, etc, etc. 这是一个简单的示例,您可以执行许多其他操作,例如设置网络设置,设置邮件帐户等。

Also, new versions of WM add more CSP's. 同样,新版本的WM添加了更多的CSP。 For example WM6.1 adds the Device Encryption Configuration Service Provider to query / enable / disable full device encryption on a WM6.1 device. 例如,WM6.1添加了设备加密配置服务提供程序,以查询/启用/禁用WM6.1设备上的完整设备加密。

Update: I copied the incorrect example!! 更新:我复制了不正确的例子! DMProcessConfigXml uses OMA Client Provisioning XML not OMA DM Provisioning XML. DMProcessConfigXml使用OMA客户端配置XML,而不是OMA DM配置XML。

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

相关问题 如何通过组注册在启动时配置设备? - How do I provision device on boot with Group Enrollment? 如何在Windows Mobile 5设备上向注册表写入值? - How do I write a value to the registry on a Windows Mobile 5 device? 如何创建数据库并为Windows Mobile 5应用程序访问数据库? - How do i create a database and access it for my windows mobile 5 app? 如何在Windows Mobile设备上设置网络连接以使用AES加密方法? - How can I set a network connection to use the AES encryption method on a Windows Mobile device? 如何在Windows Mobile设备上以kb为单位获取GPRS的总使用量? - How do I get total GPRS usage in KBs on a Windows Mobile Device? 在Windows移动设备上调试时,如何停止Visual C#2005崩溃? - How do I stop Visual C# 2005 crashing when debugging on a windows mobile device? 如何在我的 c# 应用程序中专门使用设备? - How do I use a device exclusively in my c# application? 如何通过 Razor 页面使用 51 度移动设备检测? - How Do I Use 51 Degrees Mobile Device Detection with a Razor Page? 如何固定Windows Mobile 6设备并将其与本地数据库同步? - How can I dock a Windows Mobile 6 device and sync it with a local database? 如何在Windows Mobile中获得智能设备应用程序的证书? - How can I get a certificate for a smart device application in windows mobile?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM