以 Binary 方式打开:Dim Str1 As String*2,Str2 as StringGet #1,,Str1 '最先读取两个字节
字段类型=(Asc(Str1)And &HF8)\8
字段长度=Asc(Str1)*&h100+Asc(Mid$(Str1,2,1))
Str2=Space$(字段长度)
Get #1,,Str2

解决方案 »

  1.   

    错了,是:字段长度=(Asc(Str1) And 7)*&h100+Asc(Mid$(Str1,2,1))
      

  2.   

    最完美解法(绝对不出错):Dim LoadBytes(0 To 1) As Byte
    Dim Str2 As StringGet #1,,LoadBytes '最先读取两个字节
    字段类型=(LoadBytes(0) And &HF8)\8
    字段长度=(LoadBytes(0)And 7)*&H100+LoadBytes(1)
    Str2=Space$(字段长度)
    Get #1,,Str2
      

  3.   

    2002-1-18 23:23:05 以前的方法 只适合于VB3.0以下版本。
    2002-1-18 23:23:05 适合于VB所有版本。