Скачиваний:
35
Добавлен:
01.05.2014
Размер:
1.13 Кб
Скачать
//---------------------------------------------------------------------------

#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());
  }
}
//---------------------------------------------------------------------------

Соседние файлы в папке Лабораторная работа 21