WritePrivateProfileString中的问题 [英] Problem in WritePrivateProfileString

查看:124
本文介绍了WritePrivateProfileString中的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用WritePrivateProfileString在Windows目录中写入INI文件,而使用GetPrivateProfileString从Windows目录中读取INI文件.

I am using WritePrivateProfileString for writing INI file in Windows directory and GetPrivateProfileString for reading INI file from Windows directory.

在我的一个系统中,我发现写作不起作用,但阅读效果很好.

In one of my system, I found that writing is not working but reading is working fine.

在进一步调查中,我很惊讶地在C:\ document和Settings \<用户名> \ windows中找到了另一个Windows文件夹.

On further investigation, I surprised to find another another Windows folder in C:\document and Settings\<username>\windows.

,WritePrivateProfileString正在该文件夹中写入INI文件,但从C:\ windows读取.

And WritePrivateProfileString is writing INI File in that folder, but reading from C:\windows.

知道为什么会发生吗?

更多信息Windir环境变量返回C:\ windows,并且我仅在API函数中传递文件名而不是完整路径.

More information Windir Environment variable is returning C:\windows and I am passing only file name not full path in the API function.

这个东西在所有其他系统中都可以正常工作.

This thing is working fine in all other systems.

推荐答案

Hello
我想知道您是否发现了这个问题?我有个类似的问题.

我发现在应用Visual Studio 2008 sp1补丁之前编译的vb点网程序(2005或2008)可以正常工作(它将ini文件读写到c:\ documents和设置\ {用户名} \ Windows,并在应用该修补程序后对其进行读写:c:\ Windows

我也没有在msdn上找到与此有关的任何内容
Hello
  i was wondering if you had found anyhting out on this yet?  I am having a similar problem. 

I have found out that a vb dot net program(2005, or 2008) compiled before applying the visual studio 2008 sp1 patch works just fine (it reads and writes the ini files to c:\documents and settings\{user name}\Windows, and after applying that patch it reads and writes to c:\Windows

i also have not found anything on msdn about this


这篇关于WritePrivateProfileString中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆