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
相关文档:
private static int level=0
public static int FindGUILike(ref int hWndArray,int hWndStart,ref string windowText,ref string className,ref string parentText)
{
int hwnd=0;
int r=0;
StringBuilder sWindowText=new StringBuilder();
StringBuilder sClassname=new StringBuilder();
StringBuilder sParentT ......
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); // ......
继承是派生类(子类)去实现(重写<override>、重构<new>)基类(父类)的方法或属性。从而获取在派生类中要实现的功能。
子类调用父类构造方法,在父类中有个实现姓名和年龄的构造方法但是中子类也要实现这样的功能这时子类不用再次去写这个功能只要去调用父类的功能即可。
public class Person
& ......
C#格式化数值结果表
字符
说明
示例
输出
C
货币
string.Format("{0:C3}", 2)
$2.000
D
十进制
string.Format("{0:D3}", 2)
002
E
科学计数法
1.20E+001
1.20E+001
G
常规
string.Format("{0:G}", 2)
2
N
用分号隔开的数字
string.Format("{0:N}", 250000)
250,000.00
X
十六进制
string.Forma ......
一、插图的类(含2方法)
1using System;
2using System.Collections.Generic;
3using System.Text;
4//using Excel = Microsoft.Office.Interop.Excel;
5using Excel;
6using System.Windows.Forms;
7
8
9namespace ExcelReport
10{
11 class InsertPicToExcel
12 {
13 / ......