+ Reply to Thread
Results 1 to 2 of 2

Thread: Set Binary Registry value in VB.NET

  1. #1
    sorry2culose is offline VB.NET Forum Newbie sorry2culose is on a distinguished programming path ahead
    .NET Framework
    .NET 3.0 (VS 2005/2008)
    Join Date
    Jul 2009
    Posts
    1
    Reputation
    0

    Question Set Binary Registry value in VB.NET

    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!

  2. #2
    jmcilhinney's Avatar
    jmcilhinney is offline VB.NET Forum Moderator jmcilhinney has a reputation beyond repute jmcilhinney has a reputation beyond repute jmcilhinney has a reputation beyond repute jmcilhinney has a reputation beyond repute jmcilhinney has a reputation beyond repute jmcilhinney has a reputation beyond repute jmcilhinney has a reputation beyond repute jmcilhinney has a reputation beyond repute jmcilhinney has a reputation beyond repute jmcilhinney has a reputation beyond repute jmcilhinney has a reputation beyond repute
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Age
    41
    Posts
    6,736
    Reputation
    653

    Default

    Binary data is represented using a Byte array in VB.NET. You need to assign a Byte array as the value.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts