资源简介
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个文件信息
相关资源
- DayLoadSet.csv
- ZY_winform创建不规则窗体和控件源码
- YU_字形轮廓提取显示C#源码.rar
- C#GDI绘图_设置笔刷.rar
- C#GDI绘图_BitMapDemo.rar
- C#GDI绘图_绘制图形.rar
- C#GDI绘图_窗体绘制文字.rar
- C#GDI绘图_Pen的使用合集.rar
- C#批量图片格式转换完整源码-jVox.ra
- Unity5实战使用C#和Unity开发多平台游戏
- AirPassengers.csv
- 刘铁猛《深入浅出WPF》全套真高清视
- C#从入门到精通第4版明日科技2017年
- WPF复制粘贴剪切功能.rar
- sa-C#自定义控件usercontrol--美化单选按
- Lx-C#自定义控件---实现带行数和标尺的
-
Af-C#操作xm
l文件完整源码.rar - NF-C#版本口令加密BAT源码.rar
- 同义词词库.csv
- test5.csv
- Asp.net网络硬盘系统源码.rar
- FitLine.cs
- WPFGRAPHICS.zip
- C#中主窗体Panel中加载其他多个窗体
- sitka_weather_07-2014.csv
-
BuildaWebba
sedChatusingASP.NETAjax.zip - C#传智播客.txt
- product_class(1).csv
- zw_pigant-9702763-Example_C#2005.zip
- WPFVisifire.Charts.dll
评论
共有 条评论