using System;
using System.Text;class ASCIIEncodingExample {
public static void Main() {
Char[] chars;
Byte[] bytes = new Byte[] {
65, 83, 67, 73, 73, 32, 69,
110, 99, 111, 100, 105, 110, 103,
32, 69, 120, 97, 109, 112, 108, 101
}; ASCIIEncoding ascii = new ASCIIEncoding(); int charCount = ascii.GetCharCount(bytes, 6, 8);
chars = new Char[charCount];
int charsDecodedCount = ascii.GetChars(bytes, 6, 8, chars, 0); Console.WriteLine(
"{0} characters used to decode bytes.", charsDecodedCount
); Console.Write("Decoded chars: ");
foreach (Char c in chars) {
Console.Write("[{0}]", c);
}
Console.WriteLine();
}
}
using System.Text;class ASCIIEncodingExample {
public static void Main() {
Char[] chars;
Byte[] bytes = new Byte[] {
65, 83, 67, 73, 73, 32, 69,
110, 99, 111, 100, 105, 110, 103,
32, 69, 120, 97, 109, 112, 108, 101
}; ASCIIEncoding ascii = new ASCIIEncoding(); int charCount = ascii.GetCharCount(bytes, 6, 8);
chars = new Char[charCount];
int charsDecodedCount = ascii.GetChars(bytes, 6, 8, chars, 0); Console.WriteLine(
"{0} characters used to decode bytes.", charsDecodedCount
); Console.Write("Decoded chars: ");
foreach (Char c in chars) {
Console.Write("[{0}]", c);
}
Console.WriteLine();
}
}
解决方案 »
- 为什么启动调试旁边的debug\release选项没有了??
- ASP.net添加数据的问题
- 有关服务和烦人的线程
- 郁闷!!大家看看ListView这个Bug怎样解决
- VS2005怎么学习
- ExecuteNonQuery()方法返回值为1,但是数据没插入到数据库,为什么啊?
- C# Thread.sleep()后 无法继续运行
- c#如何在picturebox中绘图而不改变图像本身
- 程序如何实现在dns区域下创建域,在线等(顶者加分)
- C# 大神请进来, C# 启动一个外部的VB的exe程序,实现启动后隐藏VB程序的界面,在后台运行
- 求教一个方法
- 怎么去掉ActiveReports for .NET的版权信息?
char A =(char)i;得到A='A'