Артем Гавриленко 3 anos atrás
pai
commit
6f1b9a8186
2 arquivos alterados com 40 adições e 21 exclusões
  1. 30 21
      Encrypter/MainWindow.xaml
  2. 10 0
      Encrypter/MainWindow.xaml.cs

+ 30 - 21
Encrypter/MainWindow.xaml

@@ -30,28 +30,30 @@
                                 VerticalAlignment="Center"
                                 HorizontalAlignment="Center"
                                 Grid.Column="0">
-                        <Label Content="Зашифровать:"/>
                         <Label Content="Ввод"/>
                         <TextBox Width="200" 
-                                 Height="40"
-                                 Margin="0,0,0,30"/>
+                                 Height="40"/>
                         <Label Content="Результат"/>
                         <TextBox Width="200" 
                                  Height="40"/>
+                        <Button Width="200"
+                                Height="40"
+                                Content="Зашифровать"/>
                     </StackPanel>
-                    
+
                     <StackPanel Orientation="Vertical"
                                 VerticalAlignment="Center"
                                 HorizontalAlignment="Center"
                                 Grid.Column="1">
-                        <Label Content="Расшифровать:"/>
                         <Label Content="Ввод"/>
                         <TextBox Width="200" 
-                                 Height="40"
-                                 Margin="0,0,0,30"/>
+                                 Height="40"/>
                         <Label Content="Результат"/>
                         <TextBox Width="200" 
                                  Height="40"/>
+                        <Button Width="200"
+                                Height="40"
+                                Content="Расшифровать"/>
                     </StackPanel>
                 </Grid>
             </TabItem>
@@ -72,28 +74,30 @@
                                 VerticalAlignment="Center"
                                 HorizontalAlignment="Center"
                                 Grid.Column="0">
-                        <Label Content="Зашифровать:"/>
                         <Label Content="Ввод"/>
                         <TextBox Width="200" 
-                                 Height="40"
-                                 Margin="0,0,0,30"/>
+                                 Height="40"/>
                         <Label Content="Результат"/>
                         <TextBox Width="200" 
                                  Height="40"/>
+                        <Button Width="200"
+                                Height="40"
+                                Content="Зашифровать"/>
                     </StackPanel>
 
                     <StackPanel Orientation="Vertical"
                                 VerticalAlignment="Center"
                                 HorizontalAlignment="Center"
                                 Grid.Column="1">
-                        <Label Content="Расшифровать:"/>
                         <Label Content="Ввод"/>
                         <TextBox Width="200" 
-                                 Height="40"
-                                 Margin="0,0,0,30"/>
+                                 Height="40"/>
                         <Label Content="Результат"/>
                         <TextBox Width="200" 
                                  Height="40"/>
+                        <Button Width="200"
+                                Height="40"
+                                Content="Расшифровать"/>
                     </StackPanel>
                 </Grid>
             </TabItem>
@@ -114,28 +118,33 @@
                                 VerticalAlignment="Center"
                                 HorizontalAlignment="Center"
                                 Grid.Column="0">
-                        <Label Content="Зашифровать:"/>
                         <Label Content="Ввод"/>
-                        <TextBox Width="200" 
-                                 Height="40"
-                                 Margin="0,0,0,30"/>
+                        <TextBox Name="sposob3_input"
+                                 Width="200" 
+                                 Height="40"/>
                         <Label Content="Результат"/>
-                        <TextBox Width="200" 
+                        <TextBox Name="sposob3_output"
+                                 Width="200" 
                                  Height="40"/>
+                        <Button Width="200"
+                                Height="40"
+                                Content="Зашифровать"
+                                Click="sposob3_encrypt"/>
                     </StackPanel>
 
                     <StackPanel Orientation="Vertical"
                                 VerticalAlignment="Center"
                                 HorizontalAlignment="Center"
                                 Grid.Column="1">
-                        <Label Content="Расшифровать:"/>
                         <Label Content="Ввод"/>
                         <TextBox Width="200" 
-                                 Height="40"
-                                 Margin="0,0,0,30"/>
+                                 Height="40"/>
                         <Label Content="Результат"/>
                         <TextBox Width="200" 
                                  Height="40"/>
+                        <Button Width="200"
+                                Height="40"
+                                Content="Расшифровать"/>
                     </StackPanel>
                 </Grid>
             </TabItem>

+ 10 - 0
Encrypter/MainWindow.xaml.cs

@@ -24,5 +24,15 @@ namespace Encrypter
         {
             InitializeComponent();
         }
+
+        private void sposob3_encrypt(object sender, RoutedEventArgs e)
+        {
+            string input = sposob3_input.Text,output="";
+            foreach (char c in input)
+            {
+                output += Encoding.ASCII.GetString(c);
+
+            }
+        }
     }
 }