流不支持写入?
using System;using System.Collections.Generic;
using System.Text;
using
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
try
{
FileStream fs = new FileStream(@"d:\hh.txt", FileMode.OpenOrCreate, FileAccess.Read);
byte[] hh = new byte[6] { 65, 66, 67, 68, 69, 70 };
foreach (byte b in hh)
{
fs.WriteByte(b);
}
fs.Position = 0;
for (int i = 0; i < fs.Length; i++)
{
Console.Write((char)fs.ReadByte());
fs.Close();
}
}
catch (Exception ex)
{
Console.Write(ex.Message);
}
finally
{
System.Threading.Thread.Sleep(1111111111);
}
}
}
}
流不支持写入
应该怎么修改???