#include "StdAfx.h"
#include "Global.h"
#include "CreatePasswordForm.h"
#include <stdio.h>
#include "DotNetString.h"


using namespace ObjDataEdit;
System::Void CreatePasswordForm::CreateCode_Click(System::Object*  sender, System::EventArgs*  e)
{
	std::string Pwd = DotNetStr::StringToChar( TB_Password->Text );
	std::string Key = DotNetStr::StringToChar( TB_Key->Text );

	switch( CB_EncodeType->SelectedIndex )
	{
	case 0:
		TB_CodeResult->Text = Global::EncodePassword( Pwd.c_str() , Key.c_str() );
		break;
	case 1:
		TB_CodeResult->Text = Global::MD5EncodePassword( Pwd.c_str() , Key.c_str() );
		break;
	}
}