下面将用到的一些简单的转换操作贴上来,方便记忆
uint--->byte[]
byte[] bpara =System.BitConverter.GetBytes(uint upara);
byte[]--->uint
uint upara= System.BitConverter.ToUint32(bpara);
byte--->char
system.convert.tochar(bpara);
char--->byte
system.convert.tobyte(cpara);
byte[]--->char[]
(1)char[] cpara= System.Text.Encoding.Default.GetChars(bpara);(1)
(2)char[] cpara=new char[bpara.length];
for(int i=0;i
(3)char[] cpara= new ASCIIEncoding().GetChars(bpara);
char[]--->byte[]
(1)byte[] bpara= System.Text.Encoding.Default.GetBytes(cpara);
(2) byte[] bpara= new ASCIIEncoding().GetBytes(cpara);
char[]--->string
String spara=new String(cpara);
string---char[]
char[] cpara=spara.ToCharArray()
uint---->char[]
(1)uint-->byte[];
(2)byte[]-->char[];
uint--->string
(1)uint-->byte[];
(2)byte[]-->char[];
(3)char[]-->string;
byte[]--->string
(1).byte[]-->char[];
(2).char[]-->string;
(3) new ASCIIEncoding().GetString(bprar);
char[]--->uint
(1).char[]-->byte[];
(2).byte[]-->uint;
string--->byte[]
bpara= System.Text.Encoding.Default.GetBytes(sPara)
string--->uint
(1)string-->byte[];
(2)byte[]-->uint;
TraceBack:http://www.cnblogs.com/huomm/archive/2008/08/29/1279417.html