資源簡介
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個文件信息
評論
共有 條評論