1 - You didn't add "Imports System.IO" to the top of the file.
2 - Just double-click the button you want to use to call the code, then add:
WriteFile()
to the code that pops up. That will call the sub "WriteFile" shown in the previous post, and the code contained within, the saving code...
You could use a save file dialog to allow the user to type in a file name, then create a new stream writer referencing the file name the user has chosen.
Private Sub WriteFile()
Dim writer As StreamWriter
Dim saveFileDialog As New SaveFileDialog()...
A boolean is basically a true or false value.
As for writing text files...
Imports System.IO
Dim writer As New StreamWriter("C:\Example.txt")
writer.WriteLine("Some line of text")
writer.WriteLine("Another line of text")
writer.Close()
That would create a text file called Example.txt...
Because I need to run several commands within one window. That way, several hundred command prompts don't open at the same time and cause the system to hang.
I'm working on a program that relies on another program to convert some data. This other program is a command line executable. The code I'm using is as follows.
Using m_process As New Process()
With m_process.StartInfo
.FileName = "cmd.exe"...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.