首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

满分求解!在C#中怎么按位读写,多谢!

2012-01-08 
满分求解!!在C#中如何按位读写,谢谢!!!!!!!!!!!!!!!!!我现在需要按12位进行读写,请高手指点~谢谢[解决办法

满分求解!!在C#中如何按位读写,谢谢!!!!!!!!!!!!!!!!!
我现在需要按12位进行读写,请高手指点~谢谢

[解决办法]

Stream fs = File.Open(filename, FileMode.Open);

fs.Seek(offset, SeekOrigin.Begin);

fs.Read(buf,0, 12);

[解决办法]
bitarray
[解决办法]
byte[] buffer = new byte[12];
Stream fs = null;
try
{
fs = new FileStream(filename, FileMode.Open,FileAccess.Read);
int count = fs.Read(buffer,0, buffer.Length);
while(count> 0)
{
//处理
count = fs.Read(buffer,0, buffer.Length);
}
}
finally
{
if(fs!=null)
fs.Close();
}

热点排行