follow my heart...
分类: C/C++
2006-09-11 13:56:08
加密
FILE *newFile;
FILE *fp;
CFileDialog openDialog(true);
CString fileName;
CString newFileName;
char m;
char n;
if(openDialog.DoModal()==IDOK)
{
//newFileName=openDialog.GetFileName();
//fp=fopen(fileName.GetBuffer(MAX_PATH),"rb");
//newFileName="1.dat";
fp=fopen("default.swf","rb");
newFile=fopen("default.dat","wb");
while(fread(&m,sizeof(char),1,fp)==1)
{
n=~m;
putc(n,newFile);
}
fclose(fp);
fclose(newFile);
}
解密
FILE *newFile;
FILE *fp;
CFileDialog openDialog(true);
CString fileName;
CString newFileName;
char m;
char n;
if(openDialog.DoModal()==IDOK)
{
//newFileName=openDialog.GetFileName();
//fp=fopen(fileName.GetBuffer(MAX_PATH),"rb");
//newFileName="1.dat";
fp=fopen("default.dat","rb");
newFile=fopen("default1.swf","wb");
while(fread(&m,sizeof(char),1,fp)==1)
{
n=~m;
putc(n,newFile);
}
fclose(fp);
fclose(newFile);
}