Jump to content



Recommended Posts

    Public Sub text_combine( _
        ByVal path_to_read_file As String, _
        ByVal path_to_append_file As String _
        System.IO.File.AppendAllText( _
            path_to_append_file, _
            System.IO.File.ReadAllText(path_to_read_file) _
    End Sub

Pedro Martins

Sharing is Knowledge!


Link to comment
Share on other sites


OpenFileDialog1.Multiselect = True

OpenFileDialog1.Filter = "Ficheiros de sql (*.sql)|*.sql"
For Each Fname As String In OpenFileDialog1.Filenames
    Dim SR As New IO.StreamReader(Fname, True)
    RichTextBox1.Text &= SR.ReadToEnd & vbLf

Verifica apenas se não precisas de terminar o último comando com ;.

Alguns clients podem optar por não o colocar nos dumps/exports, por ser o último statement.

Sérgio Ribeiro

"Great coders aren't born. They're compiled and released"
"Expert coders do not need a keyboard. They just throw magnets at the RAM chips"

Link to comment
Share on other sites


Mais uma coisa, eu utilizei este tipo de código para ir buscar o nome do ficheiro a um ficheiro .txt, mas só consigo  caso o txt tenha uma só linha, ou seja um só nome, será que me podem dizer como ir buscar o nome a cada uma das linhas e abrir cada uma das script's, juntando-as numa só.

OpenFileDialog1.Filter = "Ficheiros de texto|*.txt"
Dim coiso As New IO.StreamReader(OpenFileDialog1.FileName, True)
Dim SR As New IO.StreamReader(" pasta do ficheiro" & coiso.ReadToEnd & ".sql", True)
SaveFileDialog1.Filter = "Ficheiros sql|*.sql"
Dim objWriter As New StreamWriter(SaveFileDialog1.FileName, True)
linha = SR.ReadToEnd
linha = ""


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.