dialogmd5.cpp

来自「实现md5加密解密 实现md5加密解密 实现md5加密解密」· C++ 代码 · 共 101 行

CPP
101
字号
// DialogMD5.cpp : implementation file
//
#include "MD5.h"
#include "MD5.cpp"
#include <stdio.h>
#include<string>
#include "stdafx.h"
#include "MFC_MD5.h"
#include "DialogMD5.h"
#include<iostream>
using namespace std;

/////////////////////////////////////////////////////////////////////////////
// DialogMD5 dialog


DialogMD5::DialogMD5(CWnd* pParent /*=NULL*/)
	: CDialog(DialogMD5::IDD, pParent)
{
	//{{AFX_DATA_INIT(DialogMD5)
	m_file = _T("");
	m_file_string = _T("");
	//}}AFX_DATA_INIT
}


void DialogMD5::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(DialogMD5)
	DDX_Control(pDX, IDC_FILE, m_list_file);
	DDX_Text(pDX, IDC_EDIT1, m_file);
	DDX_LBString(pDX, IDC_FILE, m_file_string);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(DialogMD5, CDialog)
	//{{AFX_MSG_MAP(DialogMD5)
	ON_BN_CLICKED(IDC_PATH, OnOpen)
	ON_BN_CLICKED(IDC_SAVE, OnSave)
	ON_BN_CLICKED(IDC_CAU, OnCau)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// DialogMD5 message handlers


void DialogMD5::OnOpen() 
{
	// TODO: Add your control notification handler code here
	//CString fliter="TXT FILEs(*.txt)";
	CFileDialog mydialog(true);//,0,0,OFN_OVERWRITEPROMPT|OFN_HIDEREADONLY,fliter);
	if(mydialog.DoModal()==IDOK)
	{
		m_file=mydialog.GetPathName();
		UpdateData(FALSE);
	}
	m_list_file.AddString(m_file);
	UpdateData(FALSE);
	//mydialog.DoModal();
}

void DialogMD5::OnSave() 
{
	// TODO: Add your control notification handler code here
	CFileDialog mydialog(false);
	mydialog.DoModal();
}

void DialogMD5::OnCau() 
{
	// TODO: Add your control notification handler code here
/*	CString str=m_file;
	char cfile[10000];
	CFile myfile;
	myfile.Open(str,CFile::modeCreate|CFile::modeReadWrite);
	myfile.ReadHuge(cfile,10000);
    //************************
 	string password(cfile);
    MD5_CTX *before_password;
    before_password = new MD5_CTX();
    unsigned char *temp,final_string[16];
    temp =(unsigned char *)password.c_str();
    before_password->MD5Update(temp,password.size());
    before_password->MD5Final(final_string);
    
	long tmp[19];
	for(int j=0;j<16;j++)
    {
        tmp[j]=final_string[j];
		//cout<<hex<<tmp[j];
	}
*/
	//cout<<endl;
}
 


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?