StreamReader sr=File.open(@"c:\dd.dat");
string s;
while((s+=sr.readline())!=null)
{
}
sr.close();

解决方案 »

  1.   

    3楼好像这么做不行吧。
    我看网上有不少都是用BinaryReader读的,烦劳哪位用我这串数据做为样板写个例子。
      

  2.   

    参考
    public static string ByteToString(byte[] InBytes) 
    {
    string StringOut="";
    foreach (byte InByte in InBytes) 
    {
    StringOut=StringOut + String.Format("{0:X2} ",InByte);
    }
    return StringOut; 
    }
      

  3.   

    做出来了,应该是这个意思。 private string HextoStr(byte b1,byte b2,byte b3,byte b4)
    {
    ulong long_amt=0;
    long_amt|=b1;
    long_amt|=(ulong)(b2<<8);
    long_amt|=(ulong)(b3<<16);
    long_amt|=(ulong)(b4<<24);
    return long_amt.ToString();
    }