Winform中使用异或算法对数字进行加密解密 算法
场景
使用异或算法进行数字加密效果编程
注:ide
博客主页:
https://blog.csdn.net/badao_liumang_qizhi
关注公众号
霸道的程序猿
获取编程相关电子书、教程推送与免费下载。布局
新建一个Winform程序,设计窗体页面布局以下加密
而后须要添加的引用以下spa
修改其代码为.net
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace YHEnData { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { try { if (textBox1.Text != "") { textBox2.Text = (Convert.ToInt32(textBox1.Text) ^ 123).ToString(); } } catch { } } private void button2_Click(object sender, EventArgs e) { try { if (textBox2.Text != "") { textBox1.Text = (Convert.ToInt32(textBox2.Text) ^ 123).ToString(); } } catch { } } } }