[Source] Basic History system using the computer registry

Discussion in 'Programming General' started by Swan, Mar 19, 2007.

[Source] Basic History system using the computer registry
  1. Unread #1 - Mar 19, 2007 at 5:52 AM
  2. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    [Source] Basic History system using the computer registry

    Requirements:

    2 Buttons, Button1 and Button2
    1 TextBox, TextBox1
    1 WebBrowser, Web

    Code:
        Private Sub Web_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles Web.DocumentCompleted
            My.Computer.Registry.CurrentUser.CreateSubKey("Web")
            My.Computer.Registry.CurrentUser.OpenSubKey("Web", True).SetValue(Web.DocumentTitle, Web.Url.ToString)
            My.Computer.Registry.CurrentUser.Close()
        End Sub
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Web.Navigate(TextBox1.Text)
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Dim sArr() As String, s As String, i As Integer
            sArr = My.Computer.Registry.CurrentUser.OpenSubKey("Web", False).GetValueNames()
            For i = 0 To UBound(sArr)
                s = s & sArr(i) & " = " & My.Computer.Registry.CurrentUser.OpenSubKey("Web", False).GetValue(sArr(i)) & vbNewLine
            Next
    
            MsgBox(s)
        End Sub
    It can be improved, but its a nice and simple start.
     
  3. Unread #2 - Mar 19, 2007 at 9:40 AM
  4. speljohan
    Joined:
    Apr 24, 2005
    Posts:
    1,450
    Referrals:
    3
    Sythe Gold:
    0

    speljohan Guru
    Visual Basic Programmers

    [Source] Basic History system using the computer registry

    very good idea :) Altough it should be XML so that it can easily be transfered to another computer, yet it's a really good idea.
     
< Editing Text File | How to use progress bars? >

Users viewing this thread
1 guest


 
 
Adblock breaks this site