Чтение текстового файла, кодировки Dos
Код такой
Private Sub Command1_Click()
List1.Clear
Dim sName As String, nFile As Integer
Dim sTemp As String
sName = App.Path & "\" & Text1
If Dir$(sName) <> "" Then
nFile = FreeFile
Open sName For Input As #nFile
Do While Not EOF(nFile)
Line Input #nFile, sTemp
List1.AddItem sTemp
Loop
Close #nFile
End If
End Sub
Читает, но выводится ерунда.
Private Declare Function OemToChar Lib "user32" Alias "OemToCharA" (ByVal lpszSrc As String, ByVal lpszDst As String) As Long
Private Sub Command1_Click()
List1.Clear
Dim sName As String, nFile As Integer
Dim sTemp As String, sTemp2 As String
sName = App.Path & "\" & Text1
If Dir$(sName) <> "" Then
nFile = FreeFile
Open sName For Input As #nFile
Do While Not EOF(nFile)
Line Input #nFile, sTemp
sTemp2 = Space(Len(sTemp))
OemToChar sTemp, sTemp2
List1.AddItem sTemp2
Loop
Close #nFile
End If
End Sub
Примерно так.
Читай в прикрепленном файле