• Log in or sign up for an account here: https://www.sythe.org/login

[Source] Basic History system using the computer registry

Swan

When They Cry...
Joined
Jan 23, 2007
Sythe Gold
0
Messages
4,957
Age
32
Location
Australia
[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.
 
[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.
 
Runescape Gamblingrunescape gambling
Back
Top