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
Ïà¹ØÎĵµ£º
server:
Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram,ProtocolType.Udp);
IPEndPoint iep1 = new IPEndPoint(IPAddress.Broadcast, 9050);//255.255.255.255
IPEndPoint iep2 = new IPEndPoint(IPAddress.Parse("192.168.1.255"), 9050);
......
ʼþÓëίÍÐËÆºõºÜÄÑÒÔÀí½â£¬ÕâÊÇÒòΪËüÃǵÄʹÓ÷½Ê½Óë³£ÓõıàÂëÓкܴóµÄ²î±ð£¬ÀýÈçͨ³£±àдµÄ¶¼ÊÇͬ²½´úÂ룬µ÷ÓÃÒ»¸öÀàÐ͵ķ½·¨£¬»á¼´¿Ì³öÏÖ·½·¨Ö´
ÐеĽá¹û£¬ÕâÊÇ·ûºÏÂß¼µÄ¡£µ«ÔÚijЩÇé¿öÖУ¬Í¬²½´úÂëδ±ØÂú×ãÐèÇó£¬Äù«¹²Æû³µÀ´´ò¸ö±È·½£¬Èç¹û½»Í¨¹ÜÖÆÖÐÐÄÏ£ÍûÿһÁ¾¹«³µµ½´ïÒ»¸öÕ¾µãʱ¶¼·¢Ë͸ø×Ô¼ºÒ»
¸öÐźÅÒÔ±ã×Ô¼º ......
public struct POINTAPI
{
public int x;
public int y;
}
public static void GetWindowfromPoint(ref int hwnd,ref StringBuilder winText,ref StringBuilder clsName,ref StringBuilder pText)
{
int parentHandle=0;
int maxLen=128;
POINTAPI pnt = new ......
ÎÞÒâÖп´µ½ref¹Ø¼ü×Ö£¬Ö»¼ÇµÃÒ»¿ªÊ¼Ñ§Ï°C#µÄʱºò£¬ÓкܶණÎ÷¶¼Ìø¹ýÈ¥ÁË¡£ ½ñÌì¸Õ¿´¼ûÕâ¸ö¹Ø¼ü×ÖµÄʱºò£¬»¹Õæ²»ÖªµÀËüÓÐÊ²Ã´ÌØ±ðµÄµØ·½¡£googleÁËһϣ¬ÕÒµ½Ò»Æª½âÊÍµÄ±È½Ï ºÃµÄÎÄÕ¡£ÈçÏ£º C# ÖеıäÁ¿ C# ÖеÄÊý¾ÝÓÐÁ½ÖÖÀàÐÍ£ºÒýÓÃÀàÐÍ£¨reference types£©ºÍÖµÀàÐÍ£¨value types£©¡£ ¼òµ¥ÀàÐÍ£¨°üÀ¨int, long, doubleµÈ£ ......