Can someone please help me create a save button ?

jsalzm1

Member
Join Date
Jun 2015
Location
Houston
Posts
23
Im trying to create a save button that will allow the data once inserted in the form, save to a notepad file. The file can be accessed later for records. But I need to be able to save the information into notepad using Visual Basic. Can anyone help? a picture should be attached of the form

the DISPLAY HOSE button will be used later. Please ignore

Capture.jpg
 
To create a text file in VB:


Code:
Dim textfile As New System.IO.StreamWriter("file path")
textfile.WriteLine("First Line")
textfile.WriteLine("Second Line")
textfile.close
The above will create a file, you just have to specify the path (including file name and extension). It's up to you on how you want it formatted. I'd recommend just creating a basic file with "Hello World" in it so that you know how it works, then start adding your information to it.

If you want to get to a location like the users Desktop you can use:

Code:
Dim filepath as string = system.environment.GetFolderPath(Environment.SpecialFolder.Desktop))
This will return something like "C:\Users\myusername\Desktop"
 
Last edited:

Similar Topics

If a programmable controller controls the operation of a motor, what connects motor control to the PC? A) Line voltage B) I/O device C) Modem D)...
Replies
27
Views
7,101
Rockwell Migration guide did not state any action for the correction of below error: Screen 4 - 82PK961C_D: Message display object will be...
Replies
4
Views
1,820
Can someone please convert this file to PDF from RSS thanks,
Replies
2
Views
2,198
im trying to do this secuence but it dont work :(
Replies
10
Views
2,575
Our instructor never taught us how to use the internal address or how to interlock. Any help would be appreciated! Thanks in advance...
Replies
29
Views
7,232
Back
Top Bottom