SilverLight 中 String 和 byte[] 转换

System.Text.UTF8Encoding UTF8 = new UTF8Encoding();  

byte[] bytes = UTF8.GetBytes("ABCD一二三四");

 string str = UTF8.GetString(bytes, 0, bytes.Length);

注意:不能这样使用: UTF8.GetString(bytes),这个方法在SilverLight中是Protected的,编译失败

posted on 2011-04-29 15:09  lzhm  阅读(354)  评论(1编辑  收藏  举报

导航