7,785
社区成员




Option Explicit
Private Sub Form_Load()
Dim hFile As Integer
Dim iBOM As Integer
Dim bytes() As Byte
hFile = FreeFile()
Open "C:\1.txt" For Binary Access Read As #hFile
Get #hFile, , iBOM
If iBOM <> &HFEFF Then
MsgBox "不是 Unicode 格式文件。", vbExclamation
Close #hFile
Exit Sub
End If
ReDim bytes(LOF(hFile) - 3)
Get #hFile, , bytes
Close #hFile
Text1 = bytes
End Sub