测试一下读写注册表

来源:互联网 发布:ubuntu串口通信 编辑:程序博客网 时间:2024/05/16 07:22

SetRegistryKey(_T("MyTestRegister"));  //在HKEY_CURRENT_USER//software下生成 "MyTestRegister"


CString strUserName="i come from china";
WriteProfileString("LogInfo","UserName",strUserName); //向注册表HKEY_CURRENT_USER//software//MyTestRegister//LogInfo//分支下写入UserName 字符串行键值 "i come from china"

 

 

strUserName = GetProfileString("LogInfo","UserName");


读取到UserName的值   i come from china

原创粉丝点击