資源簡介
源代碼很齊全,操作步驟,數據庫用戶名和密碼均已經包含在內。可用于課程設計和畢業設計用。界面整潔并且功能齊全。

代碼片段和文件信息
//?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;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????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
?????文件???????5221??2002-09-12?18:35??第07章工資管理系統\Code\Release\Crypt.obj
?????文件??????47017??2002-09-12?18:35??第07章工資管理系統\Code\Release\datagrid.obj
?????文件??????11850??2002-09-12?18:35??第07章工資管理系統\Code\Release\FormulaDlg.obj
?????文件??????26608??2002-09-12?18:35??第07章工資管理系統\Code\Release\LoginDlg.obj
?????文件??????71261??1999-05-05?22:22??第07章工資管理系統\Code\Release\msado15.tlh
?????文件??????62378??1999-05-05?22:22??第07章工資管理系統\Code\Release\msado15.tli
?????文件??????18063??2002-09-12?18:35??第07章工資管理系統\Code\Release\PreviewDlg.obj
?????文件??????86016??2002-09-12?18:35??第07章工資管理系統\Code\Release\Salary.exe
?????文件??????15863??2002-09-12?18:35??第07章工資管理系統\Code\Release\Salary.obj
?????文件????7575332??2002-09-12?18:35??第07章工資管理系統\Code\Release\Salary.pch
?????文件???????9480??2002-09-12?18:35??第07章工資管理系統\Code\Release\Salary.res
?????文件?????132436??2002-09-12?18:35??第07章工資管理系統\Code\Release\SalaryDlg.obj
?????文件????????898??2002-09-12?18:35??第07章工資管理系統\Code\Release\StdAfx.obj
?????文件??????58368??2002-09-12?18:35??第07章工資管理系統\Code\Release\vc60.idb
?????文件???????1078??2002-08-14?22:52??第07章工資管理系統\Code\res\Salary.ico
?????文件????????398??2002-08-14?22:52??第07章工資管理系統\Code\res\Salary.rc2
............此處省略24個文件信息
評論
共有 條評論