C# ¼ÓÃܣɢÁÐËã·¨
´´½¨É¢ÁÐÂëµÄ·½·¨·Ç³£¶à£¬¼´Ê¹ÊÇͬһÖÖÉ¢ÁÐËã·¨Ò²¿ÉÒÔͨ¹ýÐí¶àÀàÀ´ÊµÏÖ£¬Ç°ÃæÕ½ڽéÉܵÄËãÒ»ÖÖ£¬ÏÂÃæÔÙ½éÉÜÒ»ÖÖ¡£ÒÔ SHA1
ΪÀý£º
string plaintext = "Ã÷ÎÄ";
byte[] srcBuffer = System.Text.Encoding.UTF8.GetBytes(plaintext);
HashAlgorithm hash = HashAlgorithm.Create("SHA1"); //½«²ÎÊý»»³É“MD5”£¬ÔòÖ´ÐÐ MD5 ¼ÓÃÜ¡£²»Çø·Ö´óСд¡£
byte[] destBuffer = hash.ComputeHash(srcBuffer);
string hashedText = BitConverter.ToString(destBuffer).Replace("-", "");
ÓõÄÊÇ HashAlgorithm
Õâ¸öÀ࣬ÆäÃû³Æ¿Õ¼äÊÇ System.Security.Cryptography
¡£Ö»ÓÃÁËËüµÄÁ½¸ö·½·¨£ºCreate
ºÍ ComputeHash
£¬ComputeHash ·µ»ØµÄÊÇ byte[]£¬ÎªÁËÏÔʾÕâÀïת»»³É×Ö·û´®£¬×ª»»Ö®ºó£¬ËüºÍÇ°Ò»½Ú½²µÄ SHA1 ½á¹ûÊÇÒ»ÑùµÄ¡£
Ò²¿ÉÒÔÓà SHA1Managed
ºÍ SHA1CryptoServiceProvider
£¬µ«ÊÇÎÒÃÇÍƼöÓñ¾Îĵķ½·¨£¬ÒòΪËü²»Éæ¼°ÀàÃû£¬Òª¸ü¸ÄËã·¨£¬Ö»ÐèÒª¸ü¸Ä Create µÄ×Ö·û´®²ÎÊý¼´¿É¡£
Ïà¹ØÎĵµ£º
C#»Ï߿ؼþµÄÓ¦ÓÃʵÀý½éÉÜ֮ǰÎÒÃÇÒªÃ÷°×ÔÚC#ÖÐûÓлÏߵĿؼþ£¬ÕâÀïдÁËÒ»¸ö£¬´ó¼Ò·ÖÏí¡£¹²ÓÐÁ½¸ö¿Ø¼þ·Ö±ðÊÇ»ºáÏߺͻÊúÏߵģ¬¹ØÓÚÔõô»Ð±ÏßÓÐÐËȤµÄ¿ÉÒÔ×öÒ»¸ö´ó¼Ò·ÖÏí¡£
C#»Ï߿ؼþÖ®ºáÏß
using System;
using System.Collections;
using System.ComponentModel; ......
ÊôÐÔÊÇÀàÖпÉÒÔÏñÀàµÄ×Ö¶ÎÒ»Ñù·ÃÎʵķ½·¨¡£ÊôÐÔ¿ÉÒÔΪÀàµÄ×Ö¶ÎÌṩ±£»¤£¬±ÜÃâ×Ö¶ÎÔÚ¶ÔÏó²»ÖªµÀÇé¿öϱ»Ð޸ġ£C#ͨ¹ýÊôÐÔÀ´Ð޸ģ¬¶Áд»ò¼ÆËã˽ÓеÄ×ֶεÄÖµ¡£ÊôÐÔÏ൱ÓÚ¶Ô×ֶηÃÎʵķâ×°¡£ÏÂÀý×Ó¿ÉÒÔÇå³þ˵Ã÷Ó´£º
class Person
{
......
Ò»¡¢C#Ô¤´¦ÀíÆ÷Ö¸ÁîÈëÃÅ #define NET11 //NET11,NET20,(±ØÐë·ÅÔÚÎļþµÚÒ»ÐÐ)
using System;
//¡ ¡
//¡ ¡
//¡ ¡
string sBeepType = s.Replace(sKey,"");
#if NET20
int.TryParse(sBeepType,out beepType); //ÔÚ.net 2.0ÖвÅÓеķ½·¨
#endif
#if ......
//Socket»ù±¾±à³Ì
//·þÎñ¶Ë£º
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
Thread mythread ;
Socket socket;
// ÇåÀíËùÓÐÕýÔÚʹÓõÄ×ÊÔ´¡£
protected override void Dispose( bool disposing )
{
try
¡¡ { ¡¡¡¡
¡¡¡¡ socket.Close();//ÊÍ·Å×ÊÔ´
......
http://download.csdn.net/source/1935080
ÕâÓ¦¸ÃËãÊÇÎҵĵÚÒ»¸ö³ÌÐò°É ºÇºÇ
×îÂé·³µÄ¼ÇµÃÊÇ×ø±êÍøµÄ¼ÆË㺯ÊýÁË
ÒÔºóд³ÌÐòÒª¼ÇµÃ¶àÓÃ×¢ÊÍ£¬Ìá¸ß¿É¶ÁÐÔ
Ë㺯Êý»ý·ÖµÄËã·¨ ÊÇÓÃÔÚX=0µÄʱºò Y=0 ÍƵ¼ÆäËûµÄÖµ
¶ÔÓÐЩº¯ÊýYÎÞ·¨»ý·ÖΪ0 µÄ»°£¬¿ÉÒÔÓûý·Ö¶à³öÀ´µÄÁ½¸ö ÍÏÀÌõÍÏÀ £¬Ò²ÐíÄܳöÀ´ -_-||
BUG ¶àÊ ......