使用Windows API保存配置参数

xiaoxiao2021-02-28  98

直接看代码吧;

void SetXXXXParams(const CString strApp, const CString strKey, CString& strValue) { CString strFilePath = GetDllPath() + _T("Connect.ini"); ::WritePrivateProfileString(strApp, strKey, strValue, strFilePath); }

如调用的时候可以这样传:

CString strPictureAddress = _T("D:\sInfo"); SetFtpAddressParams(_T("FTP_ADDRESS"), _T("FCFHT_PATH"), strPictureAddress);

结果出来就是这样子:

转载请注明原文地址: https://www.6miu.com/read-54473.html

最新回复(0)