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
Ïà¹ØÎĵµ£º
ÔÚasp.netÏîÄ¿ÖеÄÒ»¸ö°ÑÊý¾Ý µ¼³öExcel±í¸ñµÄСʼþÈçÏ£º
protected void ibnOut_Click(object sender, ImageClickEventArgs e)//µ¼³öExcel°´Å¥µÄµã»÷ʼþ
{
GridView2.DataSource = dt ......
------------------------
¡ï
Foreach £º
Óŵ㣺
1¡¢²»Óÿ¼ÂÇÊý×éÆðʼË÷ÒýÊǼ¸
int[] nArray = new int[100];
// Use "foreach" to loop array
foreach( int i in nArray )
2¡¢¶ÔÓÚ¶àάÊý×é²Ù×÷ÓÃforeach·Ç³£¼ò±ã
int[,] nVisited = new int[8,8];
// Use "for" to loop two-dimension array
for( int i = 0; i ......
¼Ì³ÐÊÇÅÉÉúÀࣨ×ÓÀࣩȥʵÏÖ£¨ÖØд<override>¡¢Öع¹<new>£©»ùÀࣨ¸¸ÀࣩµÄ·½·¨»òÊôÐÔ¡£´Ó¶ø»ñÈ¡ÔÚÅÉÉúÀàÖÐҪʵÏֵŦÄÜ¡£
×ÓÀàµ÷Óø¸À๹Ôì·½·¨£¬ÔÚ¸¸ÀàÖÐÓиöʵÏÖÐÕÃûºÍÄêÁäµÄ¹¹Ôì·½·¨µ«ÊÇÖÐ×ÓÀàҲҪʵÏÖÕâÑùµÄ¹¦ÄÜÕâʱ×ÓÀ಻ÓÃÔÙ´ÎȥдÕâ¸ö¹¦ÄÜֻҪȥµ÷Óø¸ÀàµÄ¹¦Äܼ´¿É¡£
public class Person
& ......
ÎÞÒâÖп´µ½ref¹Ø¼ü×Ö£¬Ö»¼ÇµÃÒ»¿ªÊ¼Ñ§Ï°C#µÄʱºò£¬ÓкܶණÎ÷¶¼Ìø¹ýÈ¥ÁË¡£ ½ñÌì¸Õ¿´¼ûÕâ¸ö¹Ø¼ü×ÖµÄʱºò£¬»¹Õæ²»ÖªµÀËüÓÐʲôÌرðµÄµØ·½¡£googleÁËһϣ¬ÕÒµ½Ò»Æª½âÊÍµÄ±È½Ï ºÃµÄÎÄÕ¡£ÈçÏ£º C# ÖеıäÁ¿ C# ÖеÄÊý¾ÝÓÐÁ½ÖÖÀàÐÍ£ºÒýÓÃÀàÐÍ£¨reference types£©ºÍÖµÀàÐÍ£¨value types£©¡£ ¼òµ¥ÀàÐÍ£¨°üÀ¨int, long, doubleµÈ£ ......