Winform中使用异或算法对数字进行加密解密
生活随笔
收集整理的這篇文章主要介紹了
Winform中使用异或算法对数字进行加密解密
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
場(chǎng)景
使用異或算法進(jìn)行數(shù)字加密效果
?
注:
博客主頁(yè):
https://blog.csdn.net/badao_liumang_qizhi
關(guān)注公眾號(hào)
霸道的程序猿
獲取編程相關(guān)電子書(shū)、教程推送與免費(fèi)下載。
實(shí)現(xiàn)
新建一個(gè)Winform程序,設(shè)計(jì)窗體頁(yè)面布局如下
?
然后需要添加的引用如下
?
修改其代碼為
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 { }}} }?
總結(jié)
以上是生活随笔為你收集整理的Winform中使用异或算法对数字进行加密解密的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Winform中实现根据CPU和硬盘获取
- 下一篇: Java中使用Jedis连接Redis服