Quantcast
Channel: Ler Arquivo Texto
Viewing all articles
Browse latest Browse all 3

Ler Arquivo Texto

$
0
0

Boa tarde!

Eu sei como ler arquivo texto: 

        Dim LerArquivo As System.IO.StreamReader

        'Dim fileReader As System.IO.StreamReader
        'fileReader = My.Computer.FileSystem.OpenTextFileReader("C:\\testfile.txt")
        'Dim stringReader As String
        'stringReader = fileReader.ReadLine()

        Try
            LerArquivo = System.IO.File.OpenText(CaminhoArquivo & NomeArquivo)
        Catch ex As Exception
            Return Nothing
        End Try

        Retorno = LerArquivo.ReadToEnd
        LerArquivo.Close()
O problema é que o arquivo que estou lendo tem acentos, e não retorna os caracteres corretos.

Tem alguma solução?

Aquivo texto:

OK: Serviço em Operação
[STATUS]
Versao=SP_NFE_PL_008i2
TpAmb=2
VerAplic=SP_NFE_PL_008i2
CStat=107
XMotivo=Serviço em Operação
CUF=35
DhRecbto=31/01/2018 15:33:31
TMed=1
DhRetorno=30/12/1899
XObs=


Retorno: OK: Servi�o em Opera��o [STATUS] Versao=SP_NFE_PL_008i2 TpAmb=2 VerAplic=SP_NFE_PL_008i2 CStat=107 XMotivo=Servi�o em Opera��o CUF=35 DhRecbto=31/01/2018 15:40:14 TMed=1 DhRetorno=30/12/1899 XObs=  

Obrigado!


Viewing all articles
Browse latest Browse all 3

Latest Images





Latest Images