Forum Pplware
ReadLines em ficheiro sem extensão - Versão de Impressão

+- Forum Pplware (http://forum.pplware.com)
+-- Fórum: Mais Tech (/forumdisplay.php?fid=11)
+--- Fórum: Programação e Web (/forumdisplay.php?fid=16)
+--- Tópico: ReadLines em ficheiro sem extensão (/showthread.php?tid=16464)



ReadLines em ficheiro sem extensão - a3deluxe - 19-08-2013 13:33

Boas,

Estou com dificuldades em colocar o seguinte código a ler ficheiros sem extensao, se colocar "D:\DATA.txt"
o código em baixo funciona, se colocar sem extensao não funciona.

Código:
//    Dim FILE_NAME As String = "D:\DATA"
        Dim TextLine As String = ""

        If System.IO.File.Exists(FILE_NAME) = True Then
            Dim objReader As New System.IO.StreamReader(FILE_NAME)

            Do While objReader.Peek() <> -1
                TextLine = TextLine & objReader.ReadLine() & vbNewLine

            Loop

            Dim palavras As String() = TextLine.Split(" ")

            If palavras.Length > 6 Then

                TextBox1.Text = palavras(5).Replace("N", "").Replace("", "")
                TextBox2.Text = palavras(7).Replace("N", "").Replace("", "")

            End If
        Else
            MsgBox("File Does Not Exist")
        End If