- //读一个二进制文件
- FileStream fsr = new FileStream(Server.MapPath("TextFile.txt"), FileMode.Open);
- int count2 = (int)fsr.Length;
- byte[] buffer2 = new byte[count2];
- fsr.Read(buffer2, 0, count2);
- fsr.Close();
- //输出
- Response.Write( Encoding.UTF8.GetString(buffer2));