You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1045 lines
20 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

// BlackFinderTestDlg.cpp : implementation file
//
#include "stdafx.h"
#include "BlackFinderTest.h"
#include "BlackFinderTestDlg.h"
#include "BlackFinder.h"
#include <CTime>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CBlackFinderTestDlg dialog
CBlackFinderTestDlg::CBlackFinderTestDlg(CWnd* pParent /*=NULL*/)
: CDialog(CBlackFinderTestDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CBlackFinderTestDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CBlackFinderTestDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CBlackFinderTestDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CBlackFinderTestDlg, CDialog)
//{{AFX_MSG_MAP(CBlackFinderTestDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_BUTTONCREATE, OnButtoncreate)
ON_BN_CLICKED(IDC_BUTTON_TRAVERSAL, OnButtonTraversal)
ON_BN_CLICKED(IDC_BUTTONLOAD, OnButtonload)
ON_BN_CLICKED(IDC_BUTTONFIND, OnButtonfind)
ON_BN_CLICKED(IDC_BUTTONVERSION, OnButtonversion)
ON_BN_CLICKED(IDC_BUTTONLOADBACK, OnButtonloadback)
ON_MESSAGE(WM_HASH_LIST_LOADED, OnMyListLoader)
ON_BN_CLICKED(IDC_BTN_FIND2, OnBtnFind2)
ON_BN_CLICKED(IDC_BUTTONFINDSQL, OnButtonfindsql)
ON_BN_CLICKED(IDC_BUTTONVERSIONSQL, OnButtonversionsql)
ON_BN_CLICKED(IDC_BUTTONCREATESQL, OnButtoncreatesql)
ON_BN_CLICKED(IDC_BUTTONLOADSQL, OnButtonloadsql)
ON_BN_CLICKED(IDC_BUTTONSQL, OnButtonsql)
ON_BN_CLICKED(IDC_BTN_FINDSQL2, OnBtnFindsql2)
ON_BN_CLICKED(IDC_BUTTONLOADBACKSQL, OnButtonloadbacksql)
ON_BN_CLICKED(IDC_BUTTONFINDSQ3, OnButtonfindsq3)
ON_BN_CLICKED(IDC_BUTTONSQL2, OnButtonsql2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CBlackFinderTestDlg message handlers
BOOL CBlackFinderTestDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
myInitDlg();
return TRUE; // return TRUE unless you set the focus to a control
}
void CBlackFinderTestDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CBlackFinderTestDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CBlackFinderTestDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CBlackFinderTestDlg::myInitDlg()
{
GetDlgItem(IDC_EDIT_DBFNAME)->SetWindowText("CardBlacklistAll_a.dbf");
GetDlgItem(IDC_EDITCARDID)->SetWindowText("25011510239906000027");
/* GetDlgItem(IDC_EDIT_SQLNAME)->SetWindowText("CARDBLACKLISTALL_221116103.SQB");
GetDlgItem(IDC_EDITSQLID)->SetWindowText("11010745220000010159");
GetDlgItem(IDC_EDITSQLWHERE)->SetWindowText("CARDID = '11010745220000010672'");
GetDlgItem(IDC_EDITPRIKEY)->SetWindowText("CARDID");
//GetDlgItem(IDC_EDITCOUNTS)->SetWindowText("10000000");
GetDlgItem(IDC_EDITLOAD_BACK)->SetWindowText("CARDBLACKLISTALL_1.SQB");
*/
GetDlgItem(IDC_EDIT_SQLNAME)->SetWindowText("VEHICLEGRAYLISTINC_221116103.SQB");
GetDlgItem(IDC_EDITSQLID)->SetWindowText("<EFBFBD><EFBFBD>A12345");
GetDlgItem(IDC_EDITSQLWHERE)->SetWindowText("VEHICLEID = '<27><>A12345'");
GetDlgItem(IDC_EDITPRIKEY)->SetWindowText("VEHICLEID");
//GetDlgItem(IDC_EDITCOUNTS)->SetWindowText("10000000");
GetDlgItem(IDC_EDITLOAD_BACK)->SetWindowText("VEHICLEGRAYLISTINC_1.SQB");
GetDlgItem(IDC_EDIT_SQLNAME2)->SetWindowText("BIGAPPOINT_221116103.SQB");
GetDlgItem(IDC_EDITSQLID2)->SetWindowText("A1100002023022101221");
GetDlgItem(IDC_EDITSQLWHERE2)->SetWindowText("CERNO = 'A1100002023022403389'");
GetDlgItem(IDC_EDITPRIKEY2)->SetWindowText("CERNO");
GetDlgItem(IDC_EDITLOAD_BACK2)->SetWindowText("BIGAPPOINT_1.SQB");
hdledbf =NULL;
hdlesql =NULL;
hdlesql2 = NULL;
// m_isLoad = FALSE;
char path[MAX_PATH];
GetModuleFileName(NULL, path, MAX_PATH); //<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD>磺E:\Tools\qq.exe
*strrchr(path,'\\') = '\0';
m_BasePath =path;
m_BasePath += "\\";
m_workPath = "base\\";
m_TmpPath = "temp\\";
Pinfo = (CEdit *) (GetDlgItem(IDC_EDITINFO));
}
void CBlackFinderTestDlg::OnButtoncreate()
{
// TODO: Add your control notification handler code here
if( hdledbf)
{
return;
}
hdledbf = HASH_CreateList();
if(! hdledbf )
{
AppendInfo("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>HashList dbfʧ<66><CAA7>");
return;
}
AppendInfo("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>HashList dbf <20>ɹ<EFBFBD>");
}
void CBlackFinderTestDlg::OnButtonTraversal()
{
// TODO: Add your control notification handler code here
}
void CBlackFinderTestDlg::AppendInfo(char * ptr)
{
CString cstr;
cstr = "\r\n" ;
cstr += ptr;
Pinfo->SetSel(-1);
Pinfo->ReplaceSel(cstr);
}
void CBlackFinderTestDlg::AppendInfo(CString & cstr)
{
CString ctemp;
ctemp = "\r\n" ;
ctemp += cstr;
Pinfo->SetSel(-1);
Pinfo->ReplaceSel(ctemp);
}
void CBlackFinderTestDlg::OnButtonload()
{
// TODO: Add your control notification handler code here
char buf[MAX_PATH];
int iLen;
CString cstr;
CString ctemp;
HRESULT hRet;
CString CBack;
if (! hdledbf)
{
return;
}
GetDlgItem(IDC_EDIT_DBFNAME)->GetWindowText(cstr);
cstr = m_BasePath + m_workPath +cstr;
CBack =cstr;
// strcpy(buf,"D:\\Path\\temp\\CARDBLACKLISTALL2.dbf");
// strcpy(buf,"D:\\Path\\temp\\OBUBLACKLISTINC_a.sqb");
memset(buf,0,sizeof(buf));
strcpy(buf,CBack.GetBuffer(0));
iLen =strlen(buf);
if(iLen <=4)
{
AfxMessageBox("<EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD><EFBFBD><EFBFBD>");
return;
}
if((buf[iLen -1] != 'f') || (buf[iLen -2] != 'b') || (buf[iLen -3] != 'd') || (buf[iLen -4] != '.'))
{
AfxMessageBox("<EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>dbf");
return;
}
hRet = HASH_LoadList(hdledbf,buf,"CARDID");
cstr ="load ";
cstr += buf;
if(hRet <0)
{
cstr += " ʧ<><CAA7>";
strcpy(buf,(char *) (cstr.GetBuffer(0)));
AppendInfo(buf);
return;
}
else
{
cstr += " <20>ɹ<EFBFBD>";
strcpy(buf,(char *) (cstr.GetBuffer(0)));
AppendInfo(buf);
// m_isLoad = TRUE;
}
}
void CBlackFinderTestDlg::OnButtonfind()
{
// TODO: Add your control notification handler code here
char buf[4096];
char recvbuf[1024];
CString cstr;
CString ctemp;
HRESULT hRet;
if(! hdledbf )
{
return;
}
GetDlgItem(IDC_EDITCARDID)->GetWindowText(cstr);
if(cstr.IsEmpty())
{
return;
}
if(cstr.GetLength() >= 200)
{
return;
}
strcpy(buf,cstr.GetBuffer(0));
memset(recvbuf,0,sizeof(recvbuf));
hRet = HASH_Find(hdledbf,buf,recvbuf,1024);
ctemp = "Find dbf ";
ctemp += cstr;
if(hRet <=0)
{
ctemp += " ʧ<><CAA7>";
strcpy(buf,(char *) (ctemp.GetBuffer(0)));
AppendInfo(buf);
}
else
{
ctemp += " <20>ɹ<EFBFBD> ";
ctemp += recvbuf;
strcpy(buf,(char *) (ctemp.GetBuffer(0)));
AppendInfo(buf);
}
}
void CBlackFinderTestDlg::OnButtonversion()
{
// TODO: Add your control notification handler code here
char buf[256];
char recvbuf[1024];
CString cstr;
CString ctemp;
HRESULT hRet;
if(! hdledbf)
{
return;
}
/* if(! m_isLoad)
{
return;
}
*/
memset(recvbuf,0,sizeof(recvbuf));
hRet = HASH_GetVerInfo(hdledbf,"VERSION",recvbuf,1024);
ctemp = "GetVerInfo ";
ctemp += "VERSION";
if(hRet <0)
{
ctemp += " ʧ<><CAA7>";
strcpy(buf,(char *) (ctemp.GetBuffer(0)));
AppendInfo(buf);
}
else
{
ctemp += " <20>ɹ<EFBFBD> ";
ctemp += recvbuf;
strcpy(buf,(char *) (ctemp.GetBuffer(0)));
AppendInfo(buf);
}
}
void CBlackFinderTestDlg::OnButtonloadback()
{
// TODO: Add your control notification handler code here
HRESULT hRet;
char buf1[MAX_PATH];
char buf2[MAX_PATH];
//ULONG uId;
CString cstr;
CString ctemp;
CString CBack;
if(! hdledbf)
{
return;
}
/* if(! m_isLoad)
{
return;
}
cstr = m_BasePath + "dbf\\CARDBLACKLISTINC_";
cstr = m_BasePath + "";
cstr += GetDateTimeStr();
cstr += ".sqb";
*/
cstr = m_BasePath + m_workPath + "CardBlacklistAll_";
cstr += GetDateTimeStr();
cstr += ".dbf";
GetDlgItem(IDC_EDIT_DBFNAME)->SetWindowText(cstr);
memset(buf1,0,sizeof(buf1));
memset(buf2,0,sizeof(buf2));
strcpy(buf1,cstr.GetBuffer(0));
cstr = m_BasePath + m_TmpPath + "CardBlacklistAll_1.dbf";
strcpy(buf2,cstr.GetBuffer(0));
//CBack =
/* hRet = HASH_LoadListBack(hdle,this->m_hWnd,WM_HASH_LIST_LOADED,1,
buf1,
buf2,"CARDID");
*/
hRet = HASH_LoadListBack(hdledbf,this->m_hWnd,WM_HASH_LIST_LOADED,1,
buf1,
buf2,"CARDID");
cstr = "ListBack ";
if(hRet <0)
{
cstr += " ʧ<><CAA7>";
strcpy(buf1,(char *) (cstr.GetBuffer(0)));
AppendInfo(buf1);
}
else
{
cstr += " <20>ɹ<EFBFBD>";
strcpy(buf1,(char *) (cstr.GetBuffer(0)));
AppendInfo(buf1);
}
// uId = (ULONG)WM_HASH_LIST_LOADED;
// hRet = HASH_LoadListBack(hdle,this,,1,"","","");
}
LRESULT CBlackFinderTestDlg::OnMyListLoader(WPARAM wParam,LPARAM lParam)
{
CString cstr;
CString ctemp;
CString cBack;
char buf[MAX_PATH];
char myPath[MAX_PATH];
HRESULT hRet;
cstr = m_BasePath +m_workPath;
strcpy(myPath, m_BasePath.GetBuffer(0));
cstr ="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ";
ctemp.Format("%d",wParam);
cstr += ctemp;
cBack = cstr;
if( 0 == lParam)
{
memset(buf,0,sizeof(buf));
memset(myPath,0,sizeof(myPath));
cstr += "<EFBFBD><EFBFBD>̨<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
//
AppendInfo(cstr);
if(1 == wParam)
{
GetDlgItem(IDC_EDIT_DBFNAME)->GetWindowText(ctemp);
strcpy(buf,ctemp.GetBuffer(0));
// ctemp =
//if(
hRet = HASH_BackOnline(hdledbf,myPath,buf);
if(hRet <0)
{
cBack += "<EFBFBD>л<EFBFBD>ʧ<EFBFBD><EFBFBD>";
AppendInfo(cBack);
}
else
{
cBack += "<EFBFBD>л<EFBFBD><EFBFBD>ɹ<EFBFBD>";
AppendInfo(cBack);
}
}
else if(2 == wParam)
{
GetDlgItem(IDC_EDIT_SQLNAME)->GetWindowText(ctemp);
strcpy(buf,ctemp.GetBuffer(0));
// ctemp =
//if(
hRet = HASH_BackOnline(hdlesql,myPath,buf);
if(hRet <0)
{
cBack += "<EFBFBD>л<EFBFBD>ʧ<EFBFBD><EFBFBD>";
AppendInfo(cBack);
}
else
{
cBack += "<EFBFBD>л<EFBFBD><EFBFBD>ɹ<EFBFBD>";
AppendInfo(cBack);
}
}
else
{
}
}
else
{
cstr +="<EFBFBD><EFBFBD>̨<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>";
AppendInfo(cstr);
}
return 0;
}
CString CBlackFinderTestDlg::GetDateTimeStr()
{
CString cstr;
CString ctemp;
CTime nowtime = CTime::GetCurrentTime();
int y = nowtime.GetYear();
int m = nowtime.GetMonth();
int d = nowtime.GetDay();
int h = nowtime.GetHour();
int mm = nowtime.GetMinute();
int s = nowtime.GetSecond();
ctemp.Format("%d",y);
cstr = ctemp;
ctemp.Format("%d",m);
cstr += ctemp;
ctemp.Format("%d",d);
cstr += ctemp;
ctemp.Format("%d",h);
cstr += ctemp;
ctemp.Format("%d",mm);
cstr += ctemp;
ctemp.Format("%d",s);
cstr += ctemp;
return cstr;
}
void CBlackFinderTestDlg::OnBtnFind2()
{
// TODO: Add your control notification handler code here
char buf[4096];
char recvbuf[1024];
CString cstr;
CString ctemp;
HRESULT hRet;
if(! hdledbf )
{
return;
}
GetDlgItem(IDC_EDITCARDID)->GetWindowText(cstr);
if(cstr.IsEmpty())
{
return;
}
if(cstr.GetLength() >= 200)
{
return;
}
strcpy(buf,cstr.GetBuffer(0));
memset(recvbuf,0,sizeof(recvbuf));
hRet = HASH_Find2(hdledbf,buf,recvbuf,1024);
ctemp = "Find dbf ";
ctemp += cstr;
if(hRet <=0)
{
ctemp += " ʧ<><CAA7>";
strcpy(buf,(char *) (ctemp.GetBuffer(0)));
AppendInfo(buf);
}
else
{
ctemp += " <20>ɹ<EFBFBD> ";
ctemp += recvbuf;
strcpy(buf,(char *) (ctemp.GetBuffer(0)));
AppendInfo(buf);
}
}
void CBlackFinderTestDlg::OnButtonfindsql()
{
// TODO: Add your control notification handler code here
char buf[4096];
char recvbuf[1024];
CString cstr;
CString ctemp;
HRESULT hRet;
if(! hdlesql )
{
return;
}
GetDlgItem(IDC_EDITSQLID)->GetWindowText(cstr);
if(cstr.IsEmpty())
{
return;
}
if(cstr.GetLength() >= 200)
{
return;
}
strcpy(buf,cstr.GetBuffer(0));
memset(recvbuf,0,sizeof(recvbuf));
hRet = HASH_Find(hdlesql,buf,recvbuf,1024);
ctemp = "Find sql ";
ctemp += cstr;
if(hRet <=0)
{
ctemp += " ʧ<><CAA7>";
strcpy(buf,(char *) (ctemp.GetBuffer(0)));
AppendInfo(buf);
}
else
{
ctemp += " <20>ɹ<EFBFBD> ";
ctemp += recvbuf;
strcpy(buf,(char *) (ctemp.GetBuffer(0)));
AppendInfo(buf);
}
}
void CBlackFinderTestDlg::OnButtonversionsql()
{
// TODO: Add your control notification handler code here
char buf[256];
char recvbuf[1024];
CString cstr;
CString ctemp;
HRESULT hRet;
if(! hdlesql)
{
return;
}
/* if(! m_isLoad)
{
return;
}
*/
memset(recvbuf,0,sizeof(recvbuf));
hRet = HASH_GetVerInfo(hdlesql,"VERSION",recvbuf,1024);
ctemp = "GetVerInfo ";
ctemp += "VERSION";
if(hRet <0)
{
ctemp += " ʧ<><CAA7>";
strcpy(buf,(char *) (ctemp.GetBuffer(0)));
AppendInfo(buf);
}
else
{
ctemp += " <20>ɹ<EFBFBD> ";
ctemp += recvbuf;
strcpy(buf,(char *) (ctemp.GetBuffer(0)));
AppendInfo(buf);
}
}
void CBlackFinderTestDlg::OnButtoncreatesql()
{
// TODO: Add your control notification handler code here
}
void CBlackFinderTestDlg::OnButtonloadsql()
{
// TODO: Add your control notification handler code here
char buf[MAX_PATH];
char keybuf[128];
int iLen;
CString cstr;
CString ctemp;
HRESULT hRet;
CString CBack;
if (! hdlesql)
{
return;
}
GetDlgItem(IDC_EDIT_SQLNAME)->GetWindowText(cstr);
cstr = m_BasePath + m_workPath +cstr;
CBack =cstr;
// strcpy(buf,"D:\\Path\\temp\\CARDBLACKLISTALL2.dbf");
// strcpy(buf,"D:\\Path\\temp\\OBUBLACKLISTINC_a.sqb");
memset(buf,0,sizeof(buf));
CBack.MakeLower();
strcpy(buf,CBack.GetBuffer(0));
iLen =strlen(buf);
if(iLen <=4)
{
AfxMessageBox("<EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD><EFBFBD><EFBFBD>");
return;
}
if((buf[iLen -1] != 'b') || (buf[iLen -2] != 'q') || (buf[iLen -3] != 's') || (buf[iLen -4] != '.'))
{
AfxMessageBox("<EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>sqb");
return;
}
strcpy(buf,cstr.GetBuffer(0));
GetDlgItem(IDC_EDITPRIKEY)->GetWindowText(ctemp);
iLen = ctemp.GetLength();
if( (iLen <=0) || (iLen >127))
{
AfxMessageBox("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD><EFBFBD><EFBFBD>");
return;
}
strcpy(keybuf,ctemp.GetBuffer(0));
hRet = HASH_LoadList(hdlesql,buf,keybuf);
cstr ="load ";
cstr += buf;
if(hRet <0)
{
cstr += " ʧ<><CAA7>";
strcpy(buf,(char *) (cstr.GetBuffer(0)));
AppendInfo(buf);
return;
}
else
{
cstr += " <20>ɹ<EFBFBD>";
strcpy(buf,(char *) (cstr.GetBuffer(0)));
AppendInfo(buf);
// m_isLoad = TRUE;
}
}
void CBlackFinderTestDlg::OnButtonsql()
{
// TODO: Add your control notification handler code here
if( hdlesql )
{
return;
}
hdlesql = HASH_CreateList();
if(! hdlesql)
{
AppendInfo("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>HashList sqlʧ<6C><CAA7>");
return;
}
AppendInfo("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>HashList sql <20>ɹ<EFBFBD>");
}
void CBlackFinderTestDlg::OnBtnFindsql2()
{
// TODO: Add your control notification handler code here
char buf[4096];
char recvbuf[1024];
CString cstr;
CString ctemp;
HRESULT hRet;
if(! hdlesql )
{
return;
}
GetDlgItem(IDC_EDITSQLID)->GetWindowText(cstr);
if(cstr.IsEmpty())
{
return;
}
if(cstr.GetLength() >= 200)
{
return;
}
strcpy(buf,cstr.GetBuffer(0));
memset(recvbuf,0,sizeof(recvbuf));
hRet = HASH_Find2(hdlesql,buf,recvbuf,1024);
ctemp = "Find sql ";
ctemp += cstr;
if(hRet <=0)
{
ctemp += " ʧ<><CAA7>";
strcpy(buf,(char *) (ctemp.GetBuffer(0)));
AppendInfo(buf);
}
else
{
ctemp += " <20>ɹ<EFBFBD> ";
ctemp += recvbuf;
strcpy(buf,(char *) (ctemp.GetBuffer(0)));
AppendInfo(buf);
}
}
void CBlackFinderTestDlg::OnButtonloadbacksql()
{
// TODO: Add your control notification handler code here
HRESULT hRet;
char buf1[MAX_PATH];
char buf2[MAX_PATH];
char buf3[128];
//ULONG uId;
CString cstr;
CString ctemp;
CString CBack;
int iLen;
if(! hdlesql)
{
return;
}
memset(buf1,0,sizeof(buf1));
memset(buf2,0,sizeof(buf2));
GetDlgItem(IDC_EDITLOAD_BACK)->GetWindowText(cstr);
strcpy(buf2,cstr.GetBuffer(0));
hRet = strlen(buf2);
for(int i= hRet -1; i >0; i--)
{
if('_' == buf2[i])
{
buf2[i +1] ='\0';
break;
}
}
cstr = m_BasePath + m_workPath + buf2;
cstr += GetDateTimeStr();
cstr += ".sqb";
GetDlgItem(IDC_EDIT_SQLNAME)->SetWindowText(cstr);
memset(buf1,0,sizeof(buf1));
// memset(buf2,0,sizeof(buf2));
strcpy(buf1,cstr.GetBuffer(0));
GetDlgItem(IDC_EDITLOAD_BACK)->GetWindowText(ctemp);
cstr = m_BasePath + m_TmpPath + ctemp;
memset(buf2,0,sizeof(buf2));
strcpy(buf2,cstr.GetBuffer(0));
//CBack =
/* hRet = HASH_LoadListBack(hdle,this->m_hWnd,WM_HASH_LIST_LOADED,1,
buf1,
buf2,"CARDID");
*/
GetDlgItem(IDC_EDITPRIKEY)->GetWindowText(ctemp);
iLen = ctemp.GetLength();
if( (iLen <=0) || (iLen >127))
{
AfxMessageBox("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD><EFBFBD><EFBFBD>");
return;
}
memset(buf3,0,sizeof(buf3));
strcpy(buf3,ctemp.GetBuffer(0));
hRet = HASH_LoadListBack(hdlesql,this->m_hWnd,WM_HASH_LIST_LOADED,2,
buf1,
buf2,buf3);
cstr = "ListBack ";
if(hRet <0)
{
cstr += " ʧ<><CAA7>";
strcpy(buf1,(char *) (cstr.GetBuffer(0)));
AppendInfo(buf1);
}
else
{
cstr += " <20>ɹ<EFBFBD>";
strcpy(buf1,(char *) (cstr.GetBuffer(0)));
AppendInfo(buf1);
}
// uId = (ULONG)WM_HASH_LIST_LOADED;
}
void CBlackFinderTestDlg::OnButtonfindsq3()
{
// TODO: Add your control notification handler code here
char buf[4096];
char recvbuf[1024];
CString cstr;
CString ctemp;
HRESULT hRet;
if(! hdlesql )
{
return;
}
GetDlgItem(IDC_EDITSQLWHERE)->GetWindowText(cstr);
if(cstr.IsEmpty())
{
return;
}
if(cstr.GetLength() >= 300)
{
return;
}
strcpy(buf,cstr.GetBuffer(0));
memset(recvbuf,0,sizeof(recvbuf));
hRet = HASH_Find3(hdlesql,buf,recvbuf,1024);
ctemp = "Find sql3 ";
ctemp += cstr;
if(hRet <=0)
{
ctemp += " ʧ<><CAA7>";
strcpy(buf,(char *) (ctemp.GetBuffer(0)));
AppendInfo(buf);
}
else
{
ctemp += " <20>ɹ<EFBFBD> ";
ctemp += recvbuf;
strcpy(buf,(char *) (ctemp.GetBuffer(0)));
AppendInfo(buf);
}
}
void CBlackFinderTestDlg::OnButtonsql2()
{
// TODO: Add your control notification handler code here
int i;
i =0;
}