Winform中使用异或算法对数字进行加密解密
生活随笔
收集整理的这篇文章主要介绍了
Winform中使用异或算法对数字进行加密解密
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
场景
使用异或算法进行数字加密效果
注:
博客主页:
https://blog.csdn.net/badao_liumang_qizhi
关注公众号
霸道的程序猿
获取编程相关电子书、教程推送与免费下载。
实现
新建一个Winform程序,设计窗体页面布局如下
然后需要添加的引用如下
修改其代码为
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 { }}} }
总结
以上是生活随笔为你收集整理的Winform中使用异或算法对数字进行加密解密的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: Winform中实现根据CPU和硬盘获取
- 下一篇: 'keytool' 不是内部或外部命令,