Advertisement
Unknowngama

PART 3 TUT CODE ONLY

Dec 14th, 2011
1,233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. FORM 1 Code Additions:
  2.  
  3. Load Favorites:
  4. Friend Sub Load_Favorites()
  5. Bookmarks.ListBox1.Items.Clear()
  6. Dim Contents As String = Favorites
  7. Dim FileLine As Short
  8. Dim StringData As String
  9. FileLine = FreeFile()
  10.  
  11. FileOpen(FileLine, Contents, OpenMode.Input)
  12. While Not EOF(FileLine)
  13. StringData = LineInput(FileLine)
  14. Bookmarks.ListBox1.Items.Add((StringData))
  15. End While
  16. FileClose(FileLine)
  17. End Sub
  18.  
  19.  
  20. Add Current Page:
  21. SW = System.IO.File.AppendText(Favorites)
  22. SW.WriteLine(ComboBox1.Text)
  23. SW.Flush()
  24. SW.Close()
  25.  
  26.  
  27. Show All:
  28. Bookmarks.Show()
  29.  
  30.  
  31.  
  32. Delete History:
  33. ComboBox1.Items.Clear()
  34.  
  35.  
  36. See All History:
  37.  
  38. History.Show()
  39.  
  40. Bookmarks CODES:
  41.  
  42. Dim SW As IO.StreamWriter
  43. Dim Favorites As String = "C:\app.favorites.dat"
  44.  
  45. Delete:
  46. ListBox1.Items.RemoveAt(ListBox1.SelectedIndex)
  47.  
  48.  
  49. Clear:
  50. ListBox1.Items.Clear()
  51.  
  52. Add:
  53. My.Settings.Bookmarks.Add(TextBox1.Text)
  54. ListBox1.Items.Add(TextBox1.Text)
  55. SW = System.IO.File.AppendText(Favorites)
  56. SW.WriteLine(TextBox1.Text)
  57. SW.Flush()
  58. SW.Close()
  59.  
  60. Save:
  61. My.Settings.Save
  62.  
  63.  
  64. HISTORY CODE:
  65.  
  66.  
  67. Clear Button:
  68. ListBox1.Items.Clear
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement