資源簡介
VC++與Microsoft Access數據庫實現。

代碼片段和文件信息
//?Crypt.cpp:?implementation?of?the?CCrypt?class.
//
//////////////////////////////////////////////////////////////////////
#include?“stdafx.h“
#include?“Crypt.h“
#ifdef?_DEBUG
#undef?THIS_FILE
static?char?THIS_FILE[]=__FILE__;
#define?new?DEBUG_NEW
#endif
//?常量
#define?C1?52845
#define?C2?22719
//////////////////////////////////////////////////////////////////////
//?Construction/Destruction
//////////////////////////////////////////////////////////////////////
CCrypt::CCrypt()
{
}
CCrypt::~CCrypt()
{
}
CString?CCrypt::Encrypt(CString?S?WORD?Key)?//?加密函數
{
CString?Resultstr;
int?ij;
Result=S;?//?初始化結果字符串
for(i=0;?i {
Result.SetAt(i?S.GetAt(i)^(Key>>8));?//?將密鑰移位后與字符異或
Key?=?((BYTE)Result.GetAt(i)+Key)*C1+C2;?//?產生下一個密鑰
}
S=Result;?//?保存結果
Result.Empty();?//?清除結果
for(i=0;?i {
j=(BYTE)S.GetAt(i);?//?提取字符
//?將字符轉換為兩個字母保存
str=“12“;?//?設置str長度為2
str.SetAt(0?65+j/26);
str.SetAt(1?65+j%26);
Result?+=?str;
}
return?Result;
}
CString?CCrypt::Decrypt(CString?S?WORD?Key)?//?解密函數
{
CString?Resultstr;
int?ij;
Result.Empty();?//?清楚結果
for(i=0;?i? {
j?=?((BYTE)S.GetAt(2*i)-65)*26;
j?+=?(BYTE)S.GetAt(2*i+1)-65;
str=“1“;?//?設置str長度為1
str.SetAt(0?j);
Result+=str;?//?追加字符,還原字符串
}
S=Result;?//?保存中間結果
for(i=0;?i {
Result.SetAt(i?(BYTE)S.GetAt(i)^(Key>>8));?//?將密鑰移位后與字符異或
Key?=?((BYTE)S.GetAt(i)+Key)*C1+C2;?//?產生下一個密鑰
}
return?Result;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????1110016??2002-11-11?12:22??第07章工資管理系統\Misdb.mdb
?????文件?????????23??2002-09-12?17:23??第07章工資管理系統\說明.txt
?????文件???????1798??2002-08-16?00:30??第07章工資管理系統\Code\Crypt.cpp
?????文件????????611??2002-08-05?09:52??第07章工資管理系統\Code\Crypt.h
?????文件??????18573??2002-08-14?23:24??第07章工資管理系統\Code\datagrid.cpp
?????文件???????5127??2002-08-14?23:24??第07章工資管理系統\Code\datagrid.h
?????文件?????????57??2002-08-17?01:02??第07章工資管理系統\Code\formula.ini
?????文件???????2477??2002-08-17?01:01??第07章工資管理系統\Code\FormulaDlg.cpp
?????文件???????1309??2002-08-17?00:57??第07章工資管理系統\Code\FormulaDlg.h
?????文件???????2609??2002-08-16?02:48??第07章工資管理系統\Code\LoginDlg.cpp
?????文件???????1271??2002-08-15?00:24??第07章工資管理系統\Code\LoginDlg.h
?????文件??????88840??2002-08-15?00:25??第07章工資管理系統\Code\msado15.tlh
?????文件??????75245??2002-08-15?00:25??第07章工資管理系統\Code\msado15.tli
?????文件???????2020??2002-08-23?04:39??第07章工資管理系統\Code\PreviewDlg.cpp
?????文件???????1286??2002-08-23?04:39??第07章工資管理系統\Code\PreviewDlg.h
?????文件???????3579??2002-08-14?22:52??第07章工資管理系統\Code\ReadMe.txt
?????文件???????3074??2002-08-23?04:18??第07章工資管理系統\Code\resource.h
?????文件??????46704??2002-08-23?04:36??第07章工資管理系統\Code\Salary.aps
?????文件???????5510??2002-08-26?06:11??第07章工資管理系統\Code\Salary.clw
?????文件???????2466??2002-08-16?02:47??第07章工資管理系統\Code\Salary.cpp
?????文件???????5109??2002-08-23?04:51??第07章工資管理系統\Code\Salary.dsp
?????文件????????579??2002-08-14?23:34??第07章工資管理系統\Code\Salary.dsw
?????文件???????1354??2002-08-15?00:08??第07章工資管理系統\Code\Salary.h
?????文件?????287744??2002-09-12?18:35??第07章工資管理系統\Code\Salary.ncb
?????文件??????49664??2002-09-12?18:35??第07章工資管理系統\Code\Salary.opt
?????文件???????2836??2002-09-12?18:35??第07章工資管理系統\Code\Salary.plg
?????文件??????26130??2002-08-23?04:36??第07章工資管理系統\Code\Salary.rc
?????文件??????27292??2002-09-12?17:21??第07章工資管理系統\Code\SalaryDlg.cpp
?????文件???????3055??2002-09-12?17:07??第07章工資管理系統\Code\SalaryDlg.h
?????文件????????208??2002-08-14?22:52??第07章工資管理系統\Code\StdAfx.cpp
............此處省略24個文件信息
- 上一篇:基于最小二乘法的平面擬合,圖像背景去除
- 下一篇:MFC多線程編程三個
評論
共有 條評論