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");
Ïà¹ØÎĵµ£º
×÷Õߣº¹â½ÅѾ˼¿¼ ʱ¼ä£º12/23/2009 1:51:00 PM
Ò»¿ªÊ¼¾Í¾õµÃHTML±à¼Æ÷ÕâÍæÒâÓ¦¸ÃÊǺܸßÉîĪ²âµÄ¡£ËæËæ±ã±ã¾ÍÏëÕûÒ»¸öÓ¦¸Ã²»ÊÇÒ»¼þÈÝÒ×µÄÊÂÇé¡£ºóÀ´¶ÔWebBrowser¿Ø¼þÓÐÁËһЩÁ˽⣬²»¹ý¶¼ÊǺܷôdzµÄÁ˽⡣ֻ֪µÀÓÃÕâ¸ö¿Ø¼þ¾ÍÄܹ»ÔÚ×Ô¼ºµÄ³ÌÐòÖиãÒ»¸öWEBä¯ÀÀÆ÷Ö®ÀàµÄ¶«Î÷£¬´ÓÀ´Ã»ÓÐÏë¹ýHTML±à¼Æ÷Ò²¿ÉÒÔʹÓÃÕâ¸ö¿Ø¼þÀ´ÊµÏ ......
¸ãÁ˼¸ÌìµÄÎÊÌâ¡£±àÒëÒ»¸öÎļþʱ,ÀÏÊdzöÏÂÃæÕâ¸ö´í.
checking for C compiler default output file name… configure: error: C compiler cannot create executables
û·¨×Ó,ÕÒ¸ßÈË°ïÎÒ´¦Àí,¹þ¹þ….¼Ç¼ÏÂÀ´.ÒòΪ64λµÄ»úÆ÷£¬Ä¬È϶ÔCFLAGSµÄÕâÊǽøÐÐÁËÉèÖÃ,ËùÒÔʹÓÃÏÂÃæµÄÃüÁîÇå¿ÕËû¾ÍÐÐÁË£¬ÕâÑùÈí¼þ¾Í²»»á±¨ ......
C# ÓïÑÔÖеÄÓÐЩ¹¹ÔìÒªÇóij¸öÀàÐÍÖÁÉÙÓëij¸ö³ÉÔ±»òÆäËûÀàÐ;ßÓÐͬÑùµÄ¿É·ÃÎÊÐÔ (at least as accessible as)¡£Èç¹û T µÄ¿É·ÃÎÊÓòÊÇ M ¿É·ÃÎÊÓòµÄ³¬¼¯£¬ÎÒÃǾÍ˵ÀàÐÍ T ÖÁÉÙÓë³ÉÔ±»òÀàÐÍ M ¾ßÓÐͬÑùµÄ¿É·ÃÎÊÐÔ¡£»»ÑÔÖ®£¬Èç¹û T ÔÚ¿É·ÃÎÊ M µÄËùÓÐÉÏÏÂÎÄÖж¼ÊÇ¿É·ÃÎʵģ¬Ôò T ÖÁÉÙÓë M ¾ßÓÐͬÑùµÄ¿É·ÃÎÊÐÔ¡£
´æÔÚÏÂÁпɷÃÎÊÐ ......
RT¡£ÏÈÌù´úÂë
C# code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Value_Ref_test1
{
class Program
{
static void Main(string[] args)
{
point a = new point (10,10) ;
point b = a;
......
ÏÈÌù´úÂë
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Ref_and_Out_test
{
class Program
{
static void Main(string[] args)
& ......