1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| Private Async Sub btnImprimer_Click(sender As Object, e As EventArgs) Handles btnImprimer.Click
Dim notepad As Process = New Process()
notepad.StartInfo.FileName = "Notepad.exe"
notepad.StartInfo.UseShellExecute = False
notepad.StartInfo.RedirectStandardInput = True
notepad.Start()
notepad.WaitForInputIdle()
OuvrirConnection()
Dim Select_cmd As New SQLiteCommand("Select * FROM Phrases order by Etape")
Select_cmd.Connection = ObjetConnection
Dim reader As SQLiteDataReader = Select_cmd.ExecuteReader()
If notepad.Responding Then
Do While reader.Read
Dim maLigne As String = reader.Item("Phrase_ES") & vbCrLf &
reader.Item("Phrase_FR") & vbCrLf
System.Windows.Forms.SendKeys.SendWait(maLigne)
Loop
End If
FermerConnection()
notepad.Close()
End Sub |
Partager