| 1234567891011121314151617181920212223242526272829303132333435363738 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.IO;
- using System.Linq;
- using System.Security.Cryptography;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
-
- namespace Regest
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
-
- private void button1_Click(object sender, EventArgs e)
- {
- string jqm = textBox2.Text;
- jqm = jqm +"," + workdays.Text;
- DESCryptoServiceProvider des = new DESCryptoServiceProvider();
- byte[] inputByteArray = Encoding.Default.GetBytes(jqm);
- des.Key = ASCIIEncoding.ASCII.GetBytes("vnf4s3ru");// 密钥
- des.IV = ASCIIEncoding.ASCII.GetBytes("vnf4s3ru");// 初始化向量
- MemoryStream ms = new MemoryStream();
- CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(), CryptoStreamMode.Write);
- cs.Write(inputByteArray, 0, inputByteArray.Length);
- cs.FlushFinalBlock();
- var retB = Convert.ToBase64String(ms.ToArray());
- textBox1.Text = retB;
- }
- }
- }
|