-
C# 实现 MD5加密解密算法
using System.Security.Cryptography;using System.IO; using System.Text; ///MD5加密 public string MD5Encrypt(string pToEncrypt, string sKey) { DESCryptoServiceProvider des = new DESCryptoServiceProvider(); byte[] inputByteArray = Encoding.Default.GetBytes(pToEncrypt); des.Key = ASCIIEncoding.ASCII.GetBytes(sKey); des.IV = ASCIIEncoding.ASCII.GetBytes(sKey); MemoryStream ms = new MemoryStream(); CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(),CryptoStreamMode.Write); cs.Write(inputByteArray, 0, inputByteArray.Length); cs.FlushFinalBlock(); StringBuilder ret = new StringBuilder(); foreach(byte b in ms.ToArray()) { ret.AppendFormat("{0:X2}", b); } ret.ToString(); return ret.ToString(); } ///MD5解密 public string MD5Decrypt(string pToDecrypt, string sKey) { DESCryptoServiceProvider des = new DESCryptoServiceProvider(); byte[] inputByteArray = new byte[pToDecrypt.Length / 2]; for(int x = 0; x < pToDecrypt.Length / 2; x ) { int i = (Convert.ToInt32(pToDecrypt.Substring(x * 2, 2), 16)); inputByteArray[x] = (byte)i; } des.Key = ASCIIEncoding.ASCII.GetBytes(sKey); des.IV = ASCIIEncoding.ASCII.GetBytes(sKey); MemoryStream ms = new MemoryStream(); CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(),CryptoStreamMode.Write); cs.Write(inputByteArray, 0, inputByteArray.Length); cs.FlushFinalBlock(); StringBuilder ret = new StringBuilder(); return System.Text.Encoding.Default.GetString(ms.ToArray()); }
- 2013-11-13下载
- 积分:1
-
手机QQ协议和web协议登录 完整源码下载
可选择手机QQ协议或web协议两种方式登录,手机协议使用1.4版本。 经测试 可用
- 2015-01-27下载
- 积分:1
-
C# .net 400个经典例子下载
word文档的形式,每个实例都有截图和核心源码,适合初学者学习
- 2014-03-10下载
- 积分:1
-
C# 超强生成随机数 实例源码
C# 超强生成随机数 实例源码
- 2014-06-11下载
- 积分:1
-
OPC通讯实例(C#通过OPC连接PLC读写数据)
C#通过OPC连接PLC读写数据
- 2018-10-31下载
- 积分:1
-
.NET Reflector 5.0 使用例子(反编译软件)
.NET Reflector 5.0 Release Notes 28 December 2006 Reflector is a class browser for .NET components. It allows browsing and searching the meta data, IL instructions, resources and XML documentation stored in a .NET assembly. Reflector was first released in October 2000 running on .NET Framework 1.0 Beta. LINQ and .NET Framework 3.5: Reflector supports query expressions and other concepts introduced in C# 3.5. To enable this feature select ".NET 3.5" under View, Options, Disassembler, Optimization. .NET Framework compatibility: Reflector runs on all versions of the .NET Framework using its own assembly loading infrastructure which does not rely on the Reflection API. For example, Reflector can load .NET Framework 2.0 assemblies without having the .NET Framework 2.0 installed. Assembly Lists: When launched for the first time, Reflector allows you to choose a default set of assemblies. The list of assemblies is then stored in the Reflector.cfg file and will be loaded next time you open the program. Reflector allows creating multiple assembly lists and switching between the lists using the File, Open List dialog. To choose a different set of default assemblies for the current assembly list you should remove all assemblies from the list (DEL) and invoke the Refresh command (F5). Assembly Cache: When resolving an assembly reference, Reflector will first search the local path next to the assembly holding the reference and then falls back to the cache directories defined in the Reflector.cfg file. Reflector does not search the Global Assembly Cache (GAC) unless you add "%SystemRoot%Assembly" to the cache directories list. Assembly Versioning: By default, assembly version numbers are ignored when resolving type and member references. You can enable side-by-side versioning in the options dialog but it is suggested to avoid this if possible. Add-Ins: Information about the Reflector add-in model can be found here. The most recent version of .NET Reflector is available here. Disclaimer: This software is provided "AS IS" with no warranties of any kind. The entire risk arising out of the use or performance of the software is with you.
- 2015-06-15下载
- 积分:1
-
练习数据结构用途
练习数据结构用途
- 2015-06-24下载
- 积分:1
-
sql server 2008降到sql 2005 实例源码下载
sql server 2008降到sql 2005 实例源码下载
- 2015-04-03下载
- 积分:1
-
C#三层架构0813—SqlServer带数据库-Vis-visual studio2019
三层架构增加-删除-修改-查询可以提供学习交流,谢谢C#三层架构0813—SqlServer-Vis-visual studio2019
- 2020-12-07下载
- 积分:1
-
Word格式转换(DocToDocx)
Office Word转换小工具
- 2014-04-15下载
- 积分:1