Torna al Thread
Dim filename As String
Dim giorno As String
Dim mese As String
Dim anno As String
Dim ora As String
Dim minuti As String
Dim cmd As String
Dim comandi As String
Dim SetupPath As String = Application.StartupPath & "\mysqldump.exe"
giorno = DateTime.Now.Day
mese = DateTime.Now.Month
anno = DateTime.Now.Year
ora = DateTime.Now.Hour
minuti = DateTime.Now.Minute
filename = String.Concat(database1, giorno, mese, anno, ora, minuti)
comandi = " -h" & server1 & " -u" & user1 & " -p" & password1 & " --opt --default-character-set=utf8 " & database1 & " > c:\backup\" & filename & ".sql"
cmd = (SetupPath & " " & comandi & " ")
TextBox1.Text = cmd
Try
' Process.Start(SetupPath, comandi)
Dim myprocess As New Process
Dim lines As String = ""
With myprocess
.StartInfo.FileName = SetupPath
.StartInfo.Arguments = comandi
.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
.StartInfo.RedirectStandardOutput = True
.StartInfo.UseShellExecute = False
.Start()
End With
lines = myprocess.StandardOutput.ReadToEnd
RichTextBox1.Text = lines
Catch ex As System.Exception
MessageBox.Show(ex.Message)
End Try