Hello, I am currently trying to make a web browser with Visual Studio 2005 and I am stuck with the favorites. Instead of using data files for the option I am using the registry. I was showed how to loop throgh a certain regisrty key and get all of the strings from it. Here is the code for that:
This adds the favorites from the registry into a combo box from the Data of the string.
I made it so it read the String's Name instead by changing
"values(i) = CStr(regKey.GetValue(valueNames(i)))" to
"values(i) = CStr(valueNames(i))"
I was wondering if when you click the combo box on a string, ie: google (with "http://www.google.com/" as the data) it would go to google's site.
I tried several different ways and couldn't get it.
You would see String Name, Web Browser would go to Data.
___|String Name|___________________|Data|__________________|
___|Google______|___________________|http://www.google.com/__|
___|MSN________|___________________|http://www.msn.com/____|
___|Yahoo_______|___________________|http://www.yahoo.com/__|
How would I do this?
VB.NET:
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] regKey [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Microsoft.Win32.RegistryKey = [/SIZE][SIZE=2][COLOR=#0000ff]My[/COLOR][/SIZE][SIZE=2].Computer.Registry.CurrentUser.OpenSubKey([/SIZE][SIZE=2][COLOR=#800000]"Software\Web Browser\Favorites\"[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] valueNames [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2]() = regKey.GetValueNames()[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] upperBound [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][SIZE=2] = valueNames.GetUpperBound(0)[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] values(upperBound) [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]For[/COLOR][/SIZE][SIZE=2] i [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][SIZE=2] = 0 [/SIZE][SIZE=2][COLOR=#0000ff]To[/COLOR][/SIZE][SIZE=2] upperBound [/SIZE][SIZE=2][COLOR=#0000ff]Step[/COLOR][/SIZE][SIZE=2] 1[/SIZE]
[SIZE=2][SIZE=2]values(i) = [/SIZE][SIZE=2][COLOR=#0000ff]CStr[/COLOR][/SIZE][SIZE=2](regKey.GetValue(valueNames(i)))[/SIZE]
[/SIZE][SIZE=2][COLOR=#0000ff]Next[/COLOR][/SIZE][SIZE=2] i[/SIZE]
[SIZE=2]cboFavorites.Items.AddRange(values)[/SIZE]
This adds the favorites from the registry into a combo box from the Data of the string.
I made it so it read the String's Name instead by changing
"values(i) = CStr(regKey.GetValue(valueNames(i)))" to
"values(i) = CStr(valueNames(i))"
I was wondering if when you click the combo box on a string, ie: google (with "http://www.google.com/" as the data) it would go to google's site.
I tried several different ways and couldn't get it.
You would see String Name, Web Browser would go to Data.
___|String Name|___________________|Data|__________________|
___|Google______|___________________|http://www.google.com/__|
___|MSN________|___________________|http://www.msn.com/____|
___|Yahoo_______|___________________|http://www.yahoo.com/__|
How would I do this?
Thanks