如題

解决方案 »

  1.   

    绝大多数DOS文件名后缀在Windows下继续有效,但Windows本身也引出了许多种崭新的后缀名,如:*.drv为设备驱动程序(Driver)、*.fon和*.fot都是字库文件、*.grp为分组文件(Group)、*.ini为初始化信息文件 (Initiation)、*.pif为DOS环境下的可执行文件在Windows下执行时所需要的文件格式、*.crd即卡片文件(Card)、*.rec即记录器宏文件(Record)、*.wri即文本文件(Write),它是字处理write.exe生成的文件、*.doc和*.rtf也是文本文件(Document),它们是Word产生的文件、*.cal为日历文件、*.clp是剪贴板中的文件格式、*.htm和 *.html即主页文件、*.par为交换文件、*.pwl为口令文件(Password)等等。 
      

  2.   

    如果是文本格式,打开容易 Open语句 即可如果是二进制,就难了
      

  3.   

    SoHo_Andy(冰):
    能否具體一點,小弟初學vb,很多地方不懂
      

  4.   

    '读文本文件
    Private Sub Command1_Click()
        Dim filenum         As Integer
        Dim fileContents    As String
        Dim fileInfo()      As String
        Dim i               As Integer
        
        filenum = FreeFile
        Open "d:\aa.txt" For Binary As #filenum
            fileContents = Space(LOF(filenum))
            Get #filenum, , fileContents
        Close filenum
        fileInfo = Split(fileContents, vbCrLf)
        
        For i = 0 To UBound(fileInfo) - 1
            debug.Print fileInfo(i)
        Next
    End Sub'读二进制文件
    Private Sub Command1_Click()
        Dim n As Long
        Dim arrBytes() As Byte
        
        '读出数据
        Open "d:\draw.ico" For Binary As 1
            n = LOF(1)
            ReDim arrBytes(1 To n) As Byte
            Get 1, , arrBytes
        Close 1
       
    End Sub