C#ÖÐһЩ×Ö·û´®²Ù×÷µÄ³£ÓÃÓ÷¨,c#±àÂëºÍ½âÂë
//»ñµÃºº×ÖµÄÇøλÂë
¡¡¡¡byte[] array = new byte[2];
¡¡¡¡array = System.Text.Encoding.Default.GetBytes("°¡");
int i1 = (short)(array[0] - ''\0'');
¡¡¡¡int i2 = (short)(array[1] - ''\0'');
//unicode½âÂ뷽ʽϵĺº×ÖÂë
¡¡¡¡array = System.Text.Encoding.Unicode.GetBytes("°¡");
¡¡¡¡i1 = (short)(array[0] - ''\0'');
¡¡¡¡i2 = (short)(array[1] - ''\0'');
//unicode·´½âÂëΪºº×Ö
¡¡¡¡string str = "4a55";
¡¡¡¡string s1 = str.Substring(0,2);
¡¡¡¡string s2 = str.Substring(2,2);
int t1 = Convert.ToInt32(s1,16);
¡¡¡¡int t2 = Convert.ToInt32(s2,16);
array[0] = (byte)t1;
¡¡¡¡array[1] = (byte)t2;
string s = System.Text.Encoding.Unicode.GetString(array);
//default·½Ê½·´½âÂëΪºº×Ö
¡¡¡¡array[0] = (byte)196;
¡¡¡¡array[1] = (byte)207;
¡¡¡¡s = System.Text.Encoding.Default.GetString(array);
//È¡×Ö·û´®³¤¶È
¡¡¡¡s = "iam·½Ç¹Ç¹";
¡¡¡¡int len = s.Length;//will output as 6
¡¡¡¡byte[] sarr = System.Text.Encoding.Default.GetBytes(s);
¡¡¡¡len = sarr.Length;//will output as 3+3*2=9
//×Ö·û´®Ïà¼Ó
¡¡¡¡System.Text.StringBuilder sb = new System.Text.StringBuilder("");
¡¡¡¡sb.Append("i ");
¡¡¡¡sb.Append("am ");
¡¡¡¡sb.Append("·½Ç¹Ç¹");
/////////////////////////////////////////////////////////////////////
string --> byte array
byte[] data=Syste.Text.Encoding.ASCII.GetBytes(string);
string --> byte
byte data = Convert.ToByte(string);
byte[]-->string
string string = Encoding.ASCII.GetString( bytes, 0, nBytesSize );
C# URL±àÂëÓë½âÂë
--------------------------------------------------------------------------------
×î½ü×öÁËÒ»¸öÍøվͳ¼Æ·ÖÎöϵͳ£¬ÌرðÔÚËÑË÷ÒýÇæ·ÖÎöÄÇÒ»²¿·Ö·ÑÁ˲»ÉÙʱ¼ä£¬´ÓÒѱàÂëµÄURLÖÐÌáÈ¡ËÑË÷¹Ø¼ü´ÊÔÙ½øÐнâÂë¡£Ö÷Á÷µÄËÑË÷ÒýÇæÖУ¬URLËùʹÓõÄ×Ö·û±àÂ붼²»Í¬£¬±ÈÈ磬baiduĬÈÏÊÇgb2312£¬googleĬÈÏÊÇutf-8¡£¶ø°Ù¶ÈÓû§¿ÉÒÔÖ¸¶¨utf-8±àÂë¡£ÒÔÕâÁ½¸öËÑË÷ÒýÇæ·ÖÎö£¬URL¿ÉÄÜÊÇgb2312£¬Ò²¿ÉÄÜÊÇutf-8¡£Í·´óÁË£¡¾¹ý¼¸·¬×ÁÄ¥¡£µÃ³öÒ»¸öÔÝʱ¿ÉÒÔ¶Ô¸¶µÄ¼òµ¥·½·¨¡£
ÒÔÏÂÊÇÒýÓÃƬ¶Î£º
//oStrÊÇUrlEncode±àÂë×Ö·û´®
Encoding gb2312 = Encoding.GetEncoding("gb2312");
Ïà¹ØÎĵµ£º
Boss˵£¬Òª¿´OpenGL£¬¿´ÁË¿ìÒ»¸öÔ£¬×ÜËã³öÁ˸öÏñÑùµÄ¶«Î÷£¬ÓÃCдÁ˸ö3DÃÔ¹¬£¬
ËäȻֻÓÐ350ÐÐ
´úÂ룬²»¹ý±ßѧ±ßд£¬×ã×ãдÁËÒ»ÖÜʱ¼ä£¬»¹ÊÇСÓгɾ͸еģ¬»î»î»î£¡
&n ......
±àÒ룺C³ÌÐòÖ±½Ó±àÒë³É±ê×¼µÄ¶þ½øÖÆ¿ÉÖ´ÐеĴúÂ룬µ«C#µÄÔ´³ÌÐò²¢²»ÊDZ»±àÒë³É¶þ½øÖÆ¿ÉÖ´ÐеÄÐÎʽ£¬¶øÊÇÒ»ÖÖÖмäÓïÑÔ£¨MSIL£©£¬ÀàËÆJAVAÖеÄ×Ö½ÚÂë
½á¹¹Ì壺C#µÄ½á¹¹ÌåÓëC++µÄ½á¹¹ÌåÏàËÆ¡£µ«ÊÇC#µÄ½á¹¹ÌåÓëÀàÊDz»Í¬µÄ£¬¶øÇÒ²»Ö§³Ö¼Ì³Ð¡£
Ô¤±àÒ룺C#ÖдæÔÚÔ¤±àÒëµÄÖ¸ÁîÖ§³ÖÌõ¼þ±àÒ룬¾¯¸æ£¬´íÎ󱨸æºÍ±àÒëÐпØÖÆ¡£ÆäÖ¸Áî ......
ǰЩÌì¿´ÁËÀî¸Õ<struts2+hibernate+spring>ÄÇÊéÉϵÄhibernate£¬ÅäÖÃÎļþÒ²ÊÇ°´ÕÕÉÏÃæÇýøhibernate.cfg.xmlÎļþµÄ£¬Student.javaÅäÖõÄStudent.hbm.xmlÎļþ¾õµÃҲûʲôÎÊÌ⣬µ«²»Öªµ½Ôõô»ØʾÍÊDZ¨ connection can not open¡£ÓôÃÆ°¡£¬ºóÀ´ÎҾͰÑÊéÀïÃæµÄÅäÖÃÎļþºÍÔ´Â룬¸´ÖƵ½MyEclipseÏÂÃæµÄÒ»¸öÐÂwebÏîÄ¿ÖУ¬ÔËÐ ......
×÷Õߣº¹â½ÅѾ˼¿¼ ʱ¼ä£º12/23/2009 1:51:00 PM
Ò»¿ªÊ¼¾Í¾õµÃHTML±à¼Æ÷ÕâÍæÒâÓ¦¸ÃÊǺܸßÉîĪ²âµÄ¡£ËæËæ±ã±ã¾ÍÏëÕûÒ»¸öÓ¦¸Ã²»ÊÇÒ»¼þÈÝÒ×µÄÊÂÇé¡£ºóÀ´¶ÔWebBrowser¿Ø¼þÓÐÁËһЩÁ˽⣬²»¹ý¶¼ÊǺܷôdzµÄÁ˽⡣ֻ֪µÀÓÃÕâ¸ö¿Ø¼þ¾ÍÄܹ»ÔÚ×Ô¼ºµÄ³ÌÐòÖиãÒ»¸öWEBä¯ÀÀÆ÷Ö®ÀàµÄ¶«Î÷£¬´ÓÀ´Ã»ÓÐÏë¹ýHTML±à¼Æ÷Ò²¿ÉÒÔʹÓÃÕâ¸ö¿Ø¼þÀ´ÊµÏ ......
public class yzzSerialize
{
private yzzSerialize()
{ }
private static yzzCache cache = new yzzCache();
public static T GetfromXml<T>(string xmlpath, T t)
{
using (FileStream fs = new FileStream(xmlpath, FileMode.Open, FileAcces ......