求大佬把这个加解密处理系统用mfc写,写完可以提供报酬(30)。

#include<string.h>
#include<stdlib.h>
#include <stdio.h>
#include<Windows.h>
struct password /*加密方法结构变量*/
{ 
	char ps[100];/*各项依次增加的ASCLL码值*/
	long l;   /*加密间隔字节数*/
	long wd; /*加密的字节数*/
}; 
struct password password; 
char s[200]; 
void set() //加密方法设置函数
{ 
	printf("\n输入字符对应ASCII码依次加的数:"); ;;
	scanf("%s",password.ps); 
	printf("\n输入加密间隔字节数(连续时为0):"); 
	scanf("%ld",&password.l); 
	printf("\n输入加密字节数:"); 
	scanf("%ld",&password.wd); 
	getchar();
	system("pause"); /*系统函数,按任意键继续,使界面整洁*/
}

void encode1() /*加密字符串*/
{ 
	int m,n=strlen(password.ps),d;
	int i,flag = 1; //m存储加密字符长度 ,n存储加密字符串长度 ,i 为临时变量
	char N,w; 
	char c,C; //临时字符存储变量
	FILE *result = fopen("D:\\result.txt","wt"); 
	if(result == NULL ) 
	{
		printf("无法打开 D:\\result.txt \n");
		exit(0);
	} 
	FILE *source = fopen("D:\\source.txt","wt");
	if(source == NULL ) 
	{
		printf("无法打开 D:\\source.txt \n");
		exit(0);
	}
	printf("请输入要加密的字符串:\n"); 
	scanf("%s",s);
	m=strlen(s);          //字符串字节数
	fprintf(source,"%s",s); //写入source文件
	for(i=0;i<m;i++) 
	{ 
		static int a=0; 
		if((a<password.wd)&&(i%(password.l+1)==0)) 
		{ 
			N=s[i]+password.ps[a%n]-48; 
			if(N>126) 
			{ 
				N=N%126; /*模运算*/
			} 
			fputc(N,result); 
			a++;
		}
		else 
			fputc(s[i],result); 
	} 
	printf("\n加密成功!\n"); 
	fclose(result); 
	fclose(source);
	system("pause");
}
void encode2() /*加密文件*/
{ 
	int m,n=strlen(password.ps),d;
	int i; 
	char N,w; 
	char c,C;//临时字符存储变量
	char ch;
	FILE *source = fopen("D:\\source.txt","wt");
	if(source == NULL ) 
	{
		printf("无法打开 D:\\source.txt \n");
		exit(0);
	}
    char filename[100];  //文件名 
    printf("请输入要加密的文件名及地址:\n"); 
	getchar();
    gets(filename);  //这句要用户输入文件名
	FILE *fp=fopen(filename,"r");
    if (fp==NULL)   //打开文件,并判断是否有打开错误
	{
		printf("无法打开文件\n"); 
		system("pause");
        exit(0);
	 }  
	 while((ch=fgetc(fp))!=EOF)//将指定文件内容写入source文件
	 {
		 fputc(ch,source);
	 }
	 fclose(fp);
	fclose(source);
	source=fopen("D:\\source.txt","rt+");    //让指针指向文件source开头
	FILE *result = fopen("D:\\result.txt","wt"); 
	if(result == NULL ) 
	{
		printf("无法打开 D:\\result.txt \n");
		exit(0);
	} 
	for( i=0;(c=fgetc(source)) != EOF;i++) 
		{ 
			static int a=0; 
			if((a<password.wd)&&(i%(password.l+1)==0))
			{ 
				N=c+password.ps[a%n]-48; 
				if(N>126) 
				{ 
					N=N%126; /*模运算*/
				} 
				fputc(N,result); 
				a++; 
			} 
			else fputc(N,result); 
		} 
	printf("\n加密成功!\n"); 
	fclose(result); 
	fclose(source);
	system("pause");
}
void decode() /*解密函数*/
{ 
	FILE * recall = fopen("D:\\recall.txt","wt"); 
	FILE * result = fopen("D:\\result.txt","rt"); 
	char c,N; 
	int n=strlen(password.ps), i; //n存储加密字符串长度,i为临时变量
	if(result == NULL ) 
	{
		printf("无法打开 D:\\result.txt \n");
		exit(0);
	} 
	if(recall == NULL ) 
	{
		printf("无法打开 D:\\result.txt \n");
		exit(0);
	} 

	for( i=0;(c=fgetc(result)) != EOF;i++) //对加密文件进行译码
	{ 
		static int a=0; 
		if((a<password.wd)&&(i%(password.l+1)==0))
		{ 
			N=c-(password.ps[a%n]-48); 
			if(N<=0) 
			{ 
				N=(N+126)%126; /*模运算*/
				if(N==0)
				{
					fputc('z',recall); //当N==0即原字符为’z'
				}
				else
				{
				fputc(N,recall); 
				
				}
			
			}
			else 
			{
				fputc(N,recall); 
			}
			 a++;
			
		} 
		else fputc(c,recall) ;
	} 
	printf("\n解密成功!\n"); 
	fclose(result); 
	fclose(recall);
	system("pause");
}
void cmptxt() /*比较解密文件和原始文件的一致性,一致输出原字符,不一致输出'_'*/ 
{ 

	FILE *source = fopen("D:\\source.txt","r"); 

	FILE *recall = fopen("D:\\recall.txt","r"); 
	char c,d; //临时字符存储变量
	if(source == NULL ) 
	{
		printf("不存在 D:\\source.txt 文件\n");
		system("pause");
		exit(0);
	}


	if(recall == NULL ) 
	{
		printf("不存在 D:\\recall.txt 文件\n");
		system("pause");
		exit(0);
	}

	//先从原始文件读出一个字符,若不是文件结尾,则文件容非空
	c = fgetc(source); 
	d = fgetc(recall); 
	if(c ==EOF) 
	{ 
		printf("读文件错误!!\n");
		system("pause");
		exit(0);
	} 
	if(d ==EOF) 
	{ 
		printf("读文件错误!!\n");
		system("pause");
		exit(0);
	} 
	printf("文件比较:"); 
	if(c == d) 
	{
		printf("%c",c);
	}
	else printf("_");
	while((c=fgetc(source)) != EOF && (d=fgetc(recall)) != EOF) //文件非空调用判断
	{
		if(c == d) //比较,输出字符
		{
			printf("%c",c);
		}
		else printf("_");
	}
	printf("\n");
	fclose(source); 
	fclose(recall); 
	system("pause");
}
void Printtxt() /*显示显示原始文件和解密文件函数*/
{ 
	/*以读方式打开文件*/
	FILE *source = fopen("D:\\source.txt","rt"); 
	FILE *result = fopen("D:\\result.txt","r");
	FILE *recall = fopen("D:\\recall.txt","rt"); 
	char c; //临时字符存储变量
	if(source == NULL ) 
	{
		printf("无法打开 D:\\source.txt \n");
		exit(0);
	}
	if(result == NULL ) 
	{
		printf("无法打开 D:\\result.txt \n");
		exit(0);
	}
	if(recall == NULL ) 
	{
		printf("无法打开 D:\\recall.txt \n");
		exit(0);
	}
		printf("\n原始文件:"); 
		while((c=fgetc(source)) != EOF) 
		{
			printf("%c",c);
		}
	printf("\n");
	printf("\n加密文件:");
	while((c=fgetc(result)) != EOF) //文件非空,输出加密文件
		printf("%c",c); 
	printf("\n");
	printf("\n解密文件:");
	while((c=fgetc(recall)) != EOF) //文件非空,输出解密文件
		printf("%c",c); 
	printf("\n");
	fclose(source); 
	fclose(result); 
	fclose(recall); 
	system("pause");
}  
void menu() //菜单函数
{ 
	printf("\n****文件加解密****");
	printf("\n******************\n");
	printf("* 1.设置加密方法 *(需优先设置) \n");
	printf(" \n");
	printf("* 2.加密字符串 * \n");
	printf(" \n");
	printf("* 3.加密文件 * \n");
	printf(" \n");
	printf("* 4.解密文件 * \n");
	printf(" \n");
	printf("* 5.显示文件 * \n");
	printf(" \n");
	printf("* 6.比较解密文件与原文件(需解密后才能比较,一致则输出原文件,不一致显示'_') * \n");
	printf(" \n");
	printf("* 7.退出 * \n");
	printf(" \n");
	printf("******************\n");
	printf("请选择:");
}
void creat() //创建文件
{
	FILE *f1 = fopen("D:\\source.txt","wt"); 
	FILE *f2 = fopen("D:\\result.txt","wt"); 
	FILE *f3 = fopen("D:\\recall.txt","wt"); 
	fclose(f1); 
	fclose(f2);
	fclose(f3); 
}
int main() //主函数,进行选择
{ 
	int a=0;
	menu();
	while (a!=7) 
	{ 
		scanf("%d",&a); 
		switch(a) 
		{
		case 1:
			creat();
			set(); 
			system("cls"); 
			menu(); 
			break; 
		case 2: 
			encode1(); 
			system("cls"); 
			menu(); 
			break; 
		case 3: 
			encode2(); 
			system("cls"); 
			menu(); 
			break; 
		case 4: 
			decode(); 
			system("cls"); 
			menu(); 
			break;
		case 5: 
			Printtxt(); 
			system("cls"); 
			menu(); 
			break;
		case 6 : 
			cmptxt(); 
			system("cls"); 
			menu(); 
			break;
		case 7: 
			printf("\n 结束 !\n\n"); 
			system("pause"); 
			break; 
		default: 
			printf("\n 请再次输入! \n");
			getchar();
			system("cls"); 
			menu(); 
			break;
		} 
	} 
	return 0;
}

 

MFC带UI界面?? 按钮触发?