In this example I will show you how to start an external application and how to generate a temporary file in the temp directory configured in Windows. The source code below create a text file in the temp directory and shows this file Notepad. The filename for the file is automatically generated.
Dim sw As IO.StreamWriter
Dim sTmpFile As String
'Write the temp file
sTmpFile = System.IO.Path.GetTempFileName()
sw = New IO.StreamWriter(sTmpFile, False)
sw.Write(Me.BookingRow.sCRSRecord)
sw.Close()
'Launch the external application
Dim myProcess As System.Diagnostics.Process = New System.Diagnostics.Process()
myProcess.StartInfo.FileName = "notepad.exe"
myProcess.StartInfo.Arguments = sTmpFile
myProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal myProcess.Start()
0 reacties:
Een reactie plaatsen