How to save ?

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2008
Posts: 41
Reputation: xVent is an unknown quantity at this point 
Solved Threads: 0
xVent xVent is offline Offline
Light Poster

How to save ?

 
0
  #1
Nov 1st, 2009
Hi guys , how can i save some texts from textboxes into a word in a listbox so when i will reopen the program i will continue having the save?

Regards,
xVent.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 269
Reputation: GeekByChoiCe is on a distinguished road 
Solved Threads: 54
GeekByChoiCe GeekByChoiCe is offline Offline
Posting Whiz in Training
 
0
  #2
Nov 2nd, 2009
you can either save it in My.Settings or create a xml/text file to hole the data.
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 94
Reputation: yorro has a little shameless behaviour in the past 
Solved Threads: 6
yorro yorro is offline Offline
Junior Poster in Training
 
0
  #3
Nov 3rd, 2009
You need to save the values on an external file(Settings.txt)
Last edited by yorro; Nov 3rd, 2009 at 5:39 am.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 41
Reputation: xVent is an unknown quantity at this point 
Solved Threads: 0
xVent xVent is offline Offline
Light Poster
 
-1
  #4
Nov 3rd, 2009
the problem is that i dont know the way to do it.

-xVent
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 269
Reputation: GeekByChoiCe is on a distinguished road 
Solved Threads: 54
GeekByChoiCe GeekByChoiCe is offline Offline
Posting Whiz in Training
 
0
  #5
Nov 4th, 2009
just a small example:
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2. My.Computer.FileSystem.WriteAllText("myText.txt", TextBox1.Text & "#", True)
  3. ListBox1.Items.Add(TextBox1.Text)
  4. TextBox1.Clear()
  5. End Sub
  6.  
  7. Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  8. Try
  9. For Each line As String In My.Computer.FileSystem.ReadAllText("myText.txt").Split("#")
  10. ListBox1.Items.Add(line)
  11. Next
  12. Catch ex As system.IO.FileNotFoundException
  13. 'file doesnt exist yet
  14. End Try
  15. End Sub
Reply With Quote Quick reply to this message  
Reply

Message:



Other Threads in the VB.NET Forum
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC