seldeby
asked on
save to textfile and get values from textfile to a listbox (vb.net)
Hi
I wounder how i would do if i want to save text from a textbox to file?
And how would i do if i want this from textfile to listbox.
/stefan
I wounder how i would do if i want to save text from a textbox to file?
And how would i do if i want this from textfile to listbox.
/stefan
ASKER
i'm getting an error on Imports.
It says that statements must precede any declarations.
what does that mean?
It says that statements must precede any declarations.
what does that mean?
Imports System.IO goes on the absolute first line above all other code. The rest of the code goes in your module.
ASKER
It working.
But when i'm adding it delete the old value.
How will i do so it just adds the new value after the old?
About listbox:
I want to get that are in the text to the listbox.
So the listbox will get all the values that are in the text file.
But when i'm adding it delete the old value.
How will i do so it just adds the new value after the old?
About listbox:
I want to get that are in the text to the listbox.
So the listbox will get all the values that are in the text file.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Imports System.IO
Dim f as StreamWriter = New StreamWriter("C:\temp\file
f.Write(textBox1.Text)
f.Close()