在Win2K怎样让WriteProfileString写的字符不存于注册表,而在.INI在MSDN规定:
In Windows NT, the value is stored to a registry key.In Windows 3.x, the value is stored in the WIN.INI file. In Windows 95, the value is stored in a cached version of WIN.INI. 在Win的各种版本中如何控制呢?

解决方案 »

  1.   

    用WriteProfileString函数是一定写到注册表的,
    用WritePrivateProfileString函数最后的一个参数指定文件名!
      

  2.   

    在Win98或95又怎样写到注册表呢?  能不能详细的介绍一下。。谢谢!!
      

  3.   

    在Windows用到的就是这两个函数,
    WriteProfileString()用来写注册表;
    WritePrivateProfileString()用来写INI文件。
      

  4.   

    可是我有一个基于对话框的程序,他用WriteProfileString()写的是.INI文件。该文件与.EXE同名在winnt目录下。而在Realse版下连接时不通过。这是为什么呢???
      

  5.   

    BOOL WritePrivateProfileString(
      LPCTSTR lpAppName,  // section name
      LPCTSTR lpKeyName,  // key name
      LPCTSTR lpString,   // string to add
      LPCTSTR lpFileName  // initialization file
    );《摘自MSDN》
      

  6.   

    在App类的InitInstance()里,有下面一行代码:
    SetRegistryKey(_T("your company name"));
    它的作用是告诉程序WriteProfileString()/GetProfileString(),WriteProfileInt()/GetProfileInt()的究竟在注册表还是ini文件里操作。如果有这行代码,它们就在注册表里\\hkey_current_user\software\your company name\下操作,如果把这行代码去掉,则程序在系统目录下生成同名的ini文件,并在这里操作。