Binary data is represented using a Byte array in VB.NET. You need to assign a Byte array as the value.
|
|
I am working on a vb.net project where I am trying to set a registry value to set the Internet Explorer Proxy server and exceptions for all connections. I am able to do the string registry keys but have been unable to get the binary keys to set. I have the Registry key exported that I need "merged", but I am not sure how to code setting the binary key.
Code:Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "Connections", "[binary value]", RegistryValueKind.Binary) Application.DoEvents() End Sub
--------------------------------------------------------------------------
Here are the registry values that I am trying to set...
[HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Internet Settings\Connections]
"DefaultConnectionSettings"=hex:46,00,00,00,0a,00, 00,00,03,00,00,00,0b,00,00,\
00,6d,6c,77,66,72,77,30,30,3a,38,30,4d,00,00,00,2a ,2e,63,6f,72,70,2e,66,6f,\
6f,74,6c,6f,63,6b,65,72,2e,6e,65,74,3b,31,30,2e,2a ,3b,2a,2e,77,6f,6f,6c,77,\
6f,72,74,68,2e,63,6f,6d,3b,2a,2e,66,6f,6f,74,6c,6f ,63,6b,65,72,2e,6e,65,74,\
3b,6c,6f,63,6b,65,72,6f,6e,65,3b,3c,6c,6f,63,61,6c ,3e,00,00,00,00,00,00,00,\
00,00,00,00,00,00,2e,c3,44,d0,00,ca,01,00,00,00,00 ,00,00,00,00,00,00,00,00,\
01,00,00,00,02,00,00,00,0a,db,85,02,00,00,00,00,00 ,00,00,00,41,00,4e,00,46,\
00,54,00,4c,00,30,00,31,00,00,00,07,00,31,00,30,00 ,2e,00,32,00,31,00,39,00,\
2e,00,31,00,33,00,33,00,2e,00,32,00,00,00,00,00,09 ,00,ff,ff,00,00,10,00,ff,\
ff,00,00,0a,00,ff,ff,00,00,0e,00,ff,ff,00,00,11,00 ,ff,ff,00,00,12,00,ff,ff,\
00,00,00,00,00,00,00,00,4c,4d,45,4d,68,00,00,00,28 ,97,17,00,70,97,17,00,67,\
f0,04,cd,43,d3,ba,58
"SavedLegacySettings"=hex:46,00,00,00,46,00,00,00, 03,00,00,00,0b,00,00,00,6d,\
6c,77,66,72,77,30,30,3a,38,30,4d,00,00,00,2a,2e,63 ,6f,72,70,2e,66,6f,6f,74,\
6c,6f,63,6b,65,72,2e,6e,65,74,3b,31,30,2e,2a,3b,2a ,2e,77,6f,6f,6c,77,6f,72,\
74,68,2e,63,6f,6d,3b,2a,2e,66,6f,6f,74,6c,6f,63,6b ,65,72,2e,6e,65,74,3b,6c,\
6f,63,6b,65,72,6f,6e,65,3b,3c,6c,6f,63,61,6c,3e,00 ,00,00,00,00,00,00,00,00,\
00,00,00,00,2e,c3,44,d0,00,ca,01,00,00,00,00,00,00 ,00,00,00,00,00,00,01,00,\
00,00,02,00,00,00,0a,db,85,02,00,00,00,00,00,00,00 ,00,41,00,4e,00,46,00,54,\
00,4c,00,30,00,31,00,00,00,07,00,31,00,30,00,2e,00 ,32,00,31,00,39,00,2e,00,\
31,00,33,00,33,00,2e,00,32,00,00,00,00,00,09,00,ff ,ff,00,00,10,00,ff,ff,00,\
00,0a,00,ff,ff,00,00,0e,00,ff,ff,00,00,11,00,ff,ff ,00,00,12,00,ff,ff,00,00,\
00,00,00,00,00,00,4c,4d,45,4d,68,00,00,00,28,97,17 ,00,70,97,17,00,67,f0,04,\
cd,43,d3,ba,58
"AT&T Global Network Client"=hex:46,00,00,00,04,00,00,00,03,00,00,00,0b ,00,00,\
00,6d,6c,77,66,72,77,30,30,3a,38,30,4d,00,00,00,2a ,2e,63,6f,72,70,2e,66,6f,\
6f,74,6c,6f,63,6b,65,72,2e,6e,65,74,3b,31,30,2e,2a ,3b,2a,2e,77,6f,6f,6c,77,\
6f,72,74,68,2e,63,6f,6d,3b,2a,2e,66,6f,6f,74,6c,6f ,63,6b,65,72,2e,6e,65,74,\
3b,6c,6f,63,6b,65,72,6f,6e,65,3b,3c,6c,6f,63,61,6c ,3e,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 ,00,00,00,00,00,00,00,00,\
00,00,00,00
"NationalAccess - BroadbandAccess"=hex:46,00,00,00,0e,00,00,00,03,00 ,00,00,0b,\
00,00,00,6d,6c,77,66,72,77,30,30,3a,38,30,4d,00,00 ,00,2a,2e,63,6f,72,70,2e,\
66,6f,6f,74,6c,6f,63,6b,65,72,2e,6e,65,74,3b,31,30 ,2e,2a,3b,2a,2e,77,6f,6f,\
6c,77,6f,72,74,68,2e,63,6f,6d,3b,2a,2e,66,6f,6f,74 ,6c,6f,63,6b,65,72,2e,6e,\
65,74,3b,6c,6f,63,6b,65,72,6f,6e,65,3b,3c,6c,6f,63 ,61,6c,3e,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 ,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00
--------------------------------------------------------------------------
Please help!
Binary data is represented using a Byte array in VB.NET. You need to assign a Byte array as the value.
2007, 2008, 2009, 2010
Why is my data not saved to my database? | Communicating between multiple forms
MSDN: Data Walkthroughs | "How Do I?" Videos
My Blog: Custom Events | Dynamic GDI+ Drawing
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks