SupermanKing,我用了你的方法,修改了一下代码,出了点问题,请指教!!!Private Sub Command1_Click()
Dim FileInfo() As Byte
ReDim FileInfo(1 To FileLen("C:\1.txt"))
Open "C:\1.txt" For Binary As #1
Get #1, 1, FileInfo
Close #1
Text1 = FileInfo
End Sub我要把得到的字符放到Text1文本框里,但Text1文本框全是乱码了

解决方案 »

  1.   

    参考
    http://www.chenoe.com/blog/blogview.asp?logID=1857
      

  2.   

    Private Sub Command1_Click()
    open "C:\1.txt" For Binary As #1
    text1.text=input(lof(1),1)
    Close #1
    End Sub
      

  3.   

    Private Sub Command1_Click()
        Dim s As String
        
        Open "c:\cmd.txt" For Input As #1
        
        
        Do While Not EOF(1)
            Input #1, s
            Debug.Print s
        Loop
        
        Close #1
    End Sub
      

  4.   

    如果是文本文件的画用Open  For Input 好一些。
      

  5.   

    这种方法读文件很快,值得一用,只是要改一句,就不会是乱码了!Text1 = FileInfo
    ==>
    Text1 = strconv(FileInfo,vbunicode)
      

  6.   

    同意楼上,strconv函数用处很大,查看MSDN,能在各种编码间转换