易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net(C#)字符串加密

asp.net(C#)字符串加密
2010-03-12 09:59
using System;   
using System.Collections.Generic;   
using System.Text;   
using System.Security.Cryptography;//Cryptography密码术   
namespace DAL   
{   
    public class Encry   
    {   
        public Encry() { }  
        #region AES加密   
  
        public static string Encrypt(string toEncrypt)   
        {   
            byte[] keyArray = UTF8Encoding.UTF8.GetBytes("12345678901234567890123456789012");   
            byte[] toEncryptArray = UTF8Encoding.UTF8.GetBytes(toEncrypt);   
  
            RijndaelManaged rDel = new RijndaelManaged();//using System.Security.Cryptography;   
            rDel.Key = keyArray;   
            rDel.Mode = CipherMode.ECB;//using System.Security.Cryptography;   
            rDel.Padding = PaddingMode.PKCS7;//using System.Security.Cryptography;   
  
            ICryptoTransform cTransform = rDel.CreateEncryptor();//using System.Security.Cryptography;   
            byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toE


相关文档:

C#中将控件数据导出Excel

在asp.net项目中的一个把数据 导出Excel表格的小事件如下:
 protected void ibnOut_Click(object sender, ImageClickEventArgs e)//导出Excel按钮的点击事件
        {
              GridView2.DataSource = dt ......

c# 文件传输

send :
string path = "E:\\c#\\convey_file\\convey_file\\Form1.cs"; //要传输的文件
TcpClient client = new TcpClient();
client.Connect(IPAddress.Parse("192.168.0.52"),9999);
FileStream file = new FileStream(path,FileMode.Open,FileAccess.Read); // ......

C#Windows服务程序的快速开发


C#Windows服务程序的快速开发向你介绍了在很多应用中需要做windows服务来操作数据库等操作,希望对你了解C#Windows服务程序的开发有所帮助。
C#Windows服务程序的快速开发:在很多应用中需要做windows服务来操作数据库等操作,比如
(1)一些非常慢的数据库操作,不想一次性去做,想慢慢的通过服务定时去做,比如定时为 ......

C#利用winapi定位控件位置算法

public struct RECT
{
      public int left;
      public int Top;
      public int Right;
      public int Bottom;
}
public static bool CenterMouseOn(int hwnd)
{
     ......

c#常见异常47个

  1 ArgumentException     在向方法提供的其中一个参数无效时引发的异常  
  2 AppDomainUnloadedException   在尝试访问已卸载的应用程序域时引发的异常  
  3 ArithmeticException 因算术运算、类型转换或转换操作中的错误而引发的异常  
  4 ArrayTypeMismatc ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号