Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Лабораторная работа 21 / gui
.cpp//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop 7
#include "gui.h"
#include <string>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
Tm_form *m_form;
using namespace std;
//---------------------------------------------------------------------------
__fastcall Tm_form::Tm_form(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tm_form::m_bLaunchClick(TObject *Sender)
{
char tmp[512];
m_ePassword->GetTextBuf(tmp,16);
m_tea.setPassword(string(tmp));
m_output->Clear();
m_input->GetTextBuf(tmp,m_input->MaxLength);
if(m_bEncrypt->Checked)
{
m_tea.encrypt(string(tmp));
m_output->SetTextBuf((char*)m_tea.getEncrypted().c_str());
}
else
{
m_tea.decrypt(string(tmp));
m_output->SetTextBuf((char*)m_tea.getDecrypted().c_str());
}
}
//---------------------------------------------------------------------------