简体   繁体   English

c#wince GetPrivateProfileString

[英]c# wince GetPrivateProfileString

I used GetPrivateProfileString for a .Net(C#) program for normal PCs, and I tried to use this same class for getting information from config.ini file. 我将GetPrivateProfileString用于普通PC的.Net(C#)程序,我尝试使用同一个类从config.ini文件中获取信息。

    [DllImport("coredll.dll")]
    private static extern int GetPrivateProfileString(    // GetIniValue 를 위해
        String section,
        String key,
        String def,
        StringBuilder retVal,
        int size,
        String filePath);


    [DllImport("coredll.dll")]
    private static extern long WritePrivateProfileString(  // SetIniValue를 위해
        String section,
        String key,
        String val,
        String filePath);

However, coredll.dll does not support GetPrivateProfileString and WritePrivateProfileString . 但是, coredll.dll不支持GetPrivateProfileStringWritePrivateProfileString

Is there any way to get this function for WINCE ? 有什么方法可以为WINCE获取此功能吗?

Please, help me. 请帮我。

Thanks. 谢谢。

is there any way to get this function for WINCE???? 有没有办法让这个功能为WINCE ????

No, I would expect not. 不,我不指望。 WinCe is a 'stripped down' version of Windows and there never was a need to keep backward compatibility with Win 3.1 WinCe是Windows的“精简”版本,从来没有必要保持与Win 3.1的向后兼容性

WinCE does have a registry and it's relatively easy to write your own simple ini-file parser. WinCE确实有一个注册表,编写自己的简单 ini文件解析器相对容易。

The much better idea is of course to use a more modern way to store configurations. 当然,更好的想法是使用更现代的方式来存储配置。 Like XML. 像XML一样。

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

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