Advertisement
Guest User

Untitled

a guest
Mar 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace Encrypten_en_Decrypten
  11. {
  12.     public partial class Form1 : Form
  13.     {
  14.         public Form1()
  15.         {
  16.             InitializeComponent();
  17.         }
  18.         private void button1_Click_1(object sender, EventArgs e)
  19.         {
  20.             {
  21.                 var codes = new[] { 2, 1, 0, 0, 2, 0, 2, 0, 0, 1, 0, 1, 1, 1 };
  22.                 textBox2.Text = new String(textBox1.Text.Select((c, index) => (char)(c + codes[index % codes.Length])).ToArray());
  23.             }
  24.         }
  25.         private void button2_Click_1(object sender, EventArgs e)
  26.         {
  27.             var codes = new[] { 2, 1, 0, 0, 2, 0, 2, 0, 0, 1, 0, 1, 1, 1 };
  28.             textBox3.Text = new String(textBox2.Text.Select((c, index) => (char)(c - codes[index % codes.Length])).ToArray());
  29.         }
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement