FileStream myfs=new FileStream("f:\\1.mp3",System.IO.FileMode.Open ,System.IO.FileAccess.Read);
        BinaryReader mybr=new BinaryReader(myfs,System.Text.Encoding.Default);
    long file_len=myfs.Length;
int fl=int.Parse(file_len.ToString());
Console.WriteLine("文件长度为:--"+fl.ToString()+"Byte\r\n");
byte []box=new byte[fl];
byte []a;
if(fl>128)
{   a=new byte[128];
mybr.Read(box,0,fl); //copy the data
Array.Copy(box,fl-128,a,0,128);
Console.WriteLine("文件长度为:--"+a.Length.ToString()+"Byte\r\n");
}
else
{
 a=new byte[fl];
mybr.Read(a,0,fl);
}
          myfs=new FileStream("f:\\dazhu.txt",System.IO.FileMode.Create,System.IO.FileAccess.Write);
BinaryWriter mysw=new BinaryWriter(myfs,System.Text.Encoding.Default);
mysw.Write(a);

mybr.Close();
myfs.Close();zhu.txt中为你要的东西

解决方案 »

  1.   

    其中文件dazhu.txt中为你要的东西。
      

  2.   

    private byte[] getLast128(string FileName)        {            FileStream fs = new FileStream(FileName,FileMode.Open,FileAccess.Read);            Stream stream = fs;             stream.Seek(-128,SeekOrigin.End);             const int seekPos = 128;            int rl = 0;            byte[] Info = new byte[seekPos];            rl = stream.Read(Info,0,seekPos);             fs.Close();            stream.Close();             return Info;        }