Private Sub btnnew_Click(sender As Object, e As EventArgs) Handles btnnew.Click Try Dim file_name As String = Application.StartupPath() & "/text.dat" Dim stream_writer As New IO.StreamWriter(file_name, False) Try stream_writer.WriteLine(txtname.Text) stream_writer.WriteLine(txtopd.Text) Finally stream_writer.Close() End Try Catch exc As Exception ' Report all errors. MsgBox(exc.Message, MsgBoxStyle.Exclamation, "Read " & "Error") End Try
Dim file_name As String = Application.StartupPath() & "/text.dat"Dim command as String = "type " + file_name + " > prn"Dim proc As Process = New System.Diagnostics.Process()proc.StartInfo = New System.Diagnostics.ProcessStartInfo("cmd", "/c " & command)proc.StartInfo.RedirectStandardOutput = Trueproc.StartInfo.RedirectStandardError = Trueproc.StartInfo.UseShellExecute = Falseproc.StartInfo.CreateNoWindow = Trueproc.EnableRaisingEvents = Falseproc.Start()proc.WaitForExit()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)