如何将值写入 Windows Mobile 5 设备上的注册表?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/495910/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I write a value to the registry on a Windows Mobile 5 device?
提问by MartGriff
I have a string value that I want to write to the registry as a Dword to read via another program. How can i create a new key/string using c# .net?
我有一个字符串值,我想将它作为双字写入注册表以通过另一个程序读取。如何使用 c# .net 创建新的键/字符串?
回答by Nick Berardi
You need to use Microsoft.Win32.Registry to add to the mobile device registry. All of the methods have mobile support: http://msdn.microsoft.com/en-us/library/microsoft.win32.registry_members.aspx
您需要使用 Microsoft.Win32.Registry 添加到移动设备注册表中。所有的方法都有移动支持:http: //msdn.microsoft.com/en-us/library/microsoft.win32.registry_members.aspx
回答by ctacke
Using the Microsoft.Win32.Registry classes, just like on the desktop. There is one caveat: if you're using CF 1.0 then the classes don't exist. In that case I'd recommend pulling the implementation from the old SDF 1.4 source.
使用 Microsoft.Win32.Registry 类,就像在桌面上一样。有一个警告:如果您使用的是 CF 1.0,则这些类不存在。在这种情况下,我建议从旧的 SDF 1.4 源中提取实现。
回答by Baget
You can use this class:
你可以使用这个类:
it is supported in .NET Compact Framework 3.5 and 2.0
它在 .NET Compact Framework 3.5 和 2.0 中受支持
The following links may help you:
以下链接可能对您有所帮助:
How to: Create a Key In the Registry (Visual C#)