Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. private: System::Void зашифроватьДокументToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
  2. {
  3. Form ^ activeChild = this->ActiveMdiChild;
  4. if (activeChild != nullptr)
  5. {
  6. try
  7. {
  8. RichTextBox ^ theBox = (RichTextBox ^)activeChild->ActiveControl;
  9. if (theBox != nullptr)
  10. {
  11. vector<char> V1;
  12. char V1 = Form ^ theBox.Text.ToCharArray();//Разбираем строку на символы и записываем в массив.
  13. for (int i = 0; i < arr.Length; i++)
  14. {
  15. textBox2.Text += ((int)arr[i] * key).ToString() + '-'; //Приводим символ к типу int,умножаем на 2011(переменная key) и разделяем каждый "шифрованный символ символом '-'.
  16. }
  17. }
  18. }
  19. catch (...)
  20. {
  21. MessageBox::Show(L"Ошибка шифрования");
  22. }
  23. }
  24. else
  25. {
  26. MessageBox::Show(L"Не выбрано ни одно окно");
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement