WritePrivateProfileString(TEXT("LOG"), TEXT("LEVEL"), 写入的文本, TEXT(".\\config.ini"));
CString ReadIni(CString strIniName, CString strIniFileName)
{
TCHAR szAppPath[MAX_PATH] = { 0 };
UINT uRet = GetPrivateProfileString(TEXT("Configuration"), strIniName, NULL, szAppPath, MAX_PATH, strIniFileName);
if (uRet > 2)
{
//读取配置成功
return szAppPath;
}
else
{
//读取失败
return L"";
}
}
int WritIni(CString strHeadText, CString strOption, CString strWriteText)
{
int nWritRet = WritePrivateProfileString(strHeadText, strOption, strWriteText, TEXT(".\\BackupOption.ini"));
return nWritRet;
}
int ClearingIndividualData(CString strHeadText)
{
int nClearRet = WritePrivateProfileSection(strHeadText, NULL, TEXT(".\\BackupOption.ini")); //清空整段
return nClearRet;
}
/*********************sqlite******************************************/
int SearchScanInfoCallback(void* param, int num, char** value, char** name)
{
TRACE("ID:%s\n", *(value));
TRACE("%s\n", *(value + 1));
TRACE("%s\n", *(value + 2));
TRACE("%s\n", *(value + 3));
TRACE("%s\n", *(value + 4));
TRACE("%s\n", *(value + 5));
TRACE("%s\n", *(value + 6));
TRACE("%s\n", *(value + 7));
TRACE("%s\n", *(value + 8));
TRACE("%s\n", *(value + 9));
TRACE("**************************\n");
return 0;
}
int ret = 0;
ret = sqlite3_open("BackingListInformation.db", &m_db);
char* errmsg;
//ret = sqlite3_exec(m_db, "INSERT INTO tbl_IphoneInfo VALUES (1, 'James', 24, 'Houston', 10000.00,0,0,0,0,0 ); ", NULL, NULL, &errmsg); //插入数据
//ret = sqlite3_exec(m_db, "SELECT* FROM tbl_IphoneInfo", SearchScanInfoCallback, NULL, &errmsg); //全部查询
ret = sqlite3_exec(m_db, "DELETE FROM tbl_IphoneInfo WHERE ID = 93;", NULL, NULL, &errmsg); //删除指定
// ret = sqlite3_exec(m_db, "UPDATE tbl_IphoneInfo", NULL, NULL, &errmsg); //删除指定
ret = sqlite3_exec(m_db, "SELECT* FROM tbl_IphoneInfo", SearchScanInfoCallback, NULL, &errmsg); //全部查询
if (ret != SQLITE_OK)
{
return FALSE;
}