• 大小: 0.07M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-25
  • 语言: C#
  • 标签: 其他  

资源简介

C#软件注册试用期限代码.zip

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
using System.IO;
using System.Management;


namespace ResgisterSystem
{
    class AES
    {
        #region AES加密解密
        /// 
        /// AES 加密(高级加密标准,是下一代的加密算法标准,速度快,安全级别高,目前 AES 标准的一个实现是 Rijndael 算法)
        /// 

        /// 待加密密文
        /// 加密密钥
        /// 
        public static string AESEncrypt(string EncryptString string EncryptKey)
        {
            if (string.IsNullOrEmpty(EncryptString)) { throw (new Exception(“密文不得为空“)); }
            if (string.IsNullOrEmpty(EncryptKey)) { throw (new Exception(“密钥不得为空“)); }
            string m_strEncrypt = ““;
            byte[] m_btIV = Convert.Frombase64String(EncryptKey);
            Rijndael m_AESProvider = Rijndael.Create();
            try
            {
                byte[] m_btEncryptString = Encoding.Default.GetBytes(EncryptString);
                MemoryStream m_stream = new MemoryStream();
                CryptoStream m_csstream = new CryptoStream(m_stream m_AESProvider.CreateEncryptor(Encoding.Default.GetBytes(EncryptKey) m_btIV) CryptoStreamMode.Write);
                m_csstream.Write(m_btEncryptString 0 m_btEncryptString.Length); m_csstream.FlushFinalBlock();
                m_strEncrypt = Convert.Tobase64String(m_stream.ToArray());
                m_stream.Close(); m_stream.Dispose();
                m_csstream.Close(); m_csstream.Dispose();
            }
            catch (IOException ex) { throw ex; }
            catch (CryptographicException ex) { throw ex; }
            catch (ArgumentException ex) { throw ex; }
            catch (Exception ex) { throw ex; }
            finally { m_AESProvider.Clear(); }
            return m_strEncrypt;
        }
        /// 
        /// AES 解密(高级加密标准,是下一代的加密算法标准,速度快,安全级别高,目前 AES 标准的一个实现是 Rijndael 算法)
        /// 

        /// 待解密密文
        /// 解密密钥
        /// 
        public static string AESDecrypt(string DecryptString string DecryptKey)
        {
            if (string.IsNullOrEmpty(DecryptString)) { throw (new Exception(“密文不得为空“)); }
            if (string.IsNullOrEmpty(DecryptKey)) { throw (new Exception(“密钥不得为空“)); }
            string m_strDecrypt = ““;
            byte[] m_btIV = Convert.Frombase64String(DecryptKey);
            Rijndael m_AESProvider = Rijndael.Create();
            try
            {
                byte[] m_btDecryptString = Convert.Frombase64String(DecryptString);
                MemoryStream m_stream = new MemoryStream();
                CryptoStream m_csstream = new CryptoStream(m_stream m_AESProvider.CreateDecryptor(Encoding.Default.GetBytes(DecryptKey) m_btIV) CryptoStreamMode.Write);
                m_css

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-12-01 12:52  试用\
     目录           0  2014-12-01 12:52  试用\ResgisterSystem\
     目录           0  2014-12-01 12:52  试用\ResgisterSystem\ResgisterSystem\
     文件        3914  2014-10-30 03:26  试用\ResgisterSystem\ResgisterSystem\AES.cs
     文件       19330  2014-11-01 17:15  试用\ResgisterSystem\ResgisterSystem\Form1.Designer.cs
     文件        6726  2014-11-01 17:30  试用\ResgisterSystem\ResgisterSystem\Form1.cs
     文件        5814  2014-11-01 17:15  试用\ResgisterSystem\ResgisterSystem\Form1.resx
     文件        2243  2014-10-30 15:24  试用\ResgisterSystem\ResgisterSystem\MD5.cs
     文件         496  2014-10-30 01:30  试用\ResgisterSystem\ResgisterSystem\Program.cs
     目录           0  2014-12-01 12:52  试用\ResgisterSystem\ResgisterSystem\Properties\
     文件        1362  2014-10-30 01:30  试用\ResgisterSystem\ResgisterSystem\Properties\AssemblyInfo.cs
     文件        2880  2014-10-30 01:30  试用\ResgisterSystem\ResgisterSystem\Properties\Resources.Designer.cs
     文件        5612  2014-10-30 01:30  试用\ResgisterSystem\ResgisterSystem\Properties\Resources.resx
     文件        1100  2014-10-30 01:30  试用\ResgisterSystem\ResgisterSystem\Properties\Settings.Designer.cs
     文件         249  2014-10-30 01:30  试用\ResgisterSystem\ResgisterSystem\Properties\Settings.settings
     文件        5940  2014-10-31 18:45  试用\ResgisterSystem\ResgisterSystem\ResgisterSystem.csproj
     文件         488  2014-10-30 05:09  试用\ResgisterSystem\ResgisterSystem\ResgisterSystem.csproj.user
     文件        1831  2014-10-31 17:45  试用\ResgisterSystem\ResgisterSystem\SaoMiaoYingJian.cs
     目录           0  2014-12-01 12:52  试用\ResgisterSystem\ResgisterSystem\bin\
     目录           0  2014-12-01 12:52  试用\ResgisterSystem\ResgisterSystem\bin\Debug\
     文件       20992  2014-11-15 20:39  试用\ResgisterSystem\ResgisterSystem\bin\Debug\ResgisterSystem.exe
     文件       54784  2014-11-15 20:39  试用\ResgisterSystem\ResgisterSystem\bin\Debug\ResgisterSystem.pdb
     文件       14328  2014-11-21 22:10  试用\ResgisterSystem\ResgisterSystem\bin\Debug\ResgisterSystem.vshost.exe
     文件         490  2009-06-11 05:14  试用\ResgisterSystem\ResgisterSystem\bin\Debug\ResgisterSystem.vshost.exe.manifest
     目录           0  2014-12-01 12:52  试用\ResgisterSystem\ResgisterSystem\obj\
     目录           0  2014-12-01 12:52  试用\ResgisterSystem\ResgisterSystem\obj\Debug\
     目录           0  2014-10-01 13:30  试用\ResgisterSystem\ResgisterSystem\obj\Debug\Refactor\
     文件         180  2015-05-30 18:13  试用\ResgisterSystem\ResgisterSystem\obj\Debug\ResgisterSystem.Form1.resources
     文件         180  2014-10-31 18:46  试用\ResgisterSystem\ResgisterSystem\obj\Debug\ResgisterSystem.Properties.Resources.resources
     文件        1270  2014-11-21 22:10  试用\ResgisterSystem\ResgisterSystem\obj\Debug\ResgisterSystem.csproj.FileListAbsolute.txt
     文件         910  2014-11-15 19:06  试用\ResgisterSystem\ResgisterSystem\obj\Debug\ResgisterSystem.csproj.GenerateResource.Cache
............此处省略10个文件信息

评论

共有 条评论