none
VB.NET如何修改与读取二进制注册表? RRS feed

  • 问题

  • 请问如何在vb.net中修改
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections
    下的
    DefaultConnectionSettings

    他是控制IE代理IP的注册键,如何进行修改和读取呢?
    Registry没有找到相关资料介绍修改二进制的注册表。
    2010年1月29日 5:51

答案

全部回复

  • 通过  Registry类的SetValue 方法 和GetValue方法http://msdn.microsoft.com/zh-cn/architecture/3dwk5axy.aspx

    通过RegistryKey也可以  http://technet.microsoft.com/zh-cn/library/microsoft.win32.registrykey.setvalue.aspx
    Memory all alone in the moonlight~My Blog in .NET~~~
    2010年1月29日 6:16
    版主
  • 您好,请问注册表的格式怎么定呢?
    "DefaultConnectionSettings"=hex:46,00,00,00,e0,01,00,00,09,00,00,00,12,00,00,\
      00,32,32,32,2e,32,32,32,2e,32,32,32,2e,32,32,32,3a,38,30,07,00,00,00,3c,6c,\
      6f,63,61,6c,3e,00,00,00,00,04,00,00,00,00,00,00,00,90,67,15,04,42,9f,ca,01,\
      00,00,00,00,00,00,00,00,00,00,00,00,05,00,00,00,17,00,00,00,00,00,00,00,fe,\
      80,00,00,00,00,00,00,ad,8e,0a,11,97,66,b9,25,14,00,00,00,00,00,00,00,17,00,\
      00,00,00,00,00,00,fe,80,00,00,00,00,00,00,ad,8e,0a,11,97,66,b9,25,14,00,00,\
      00,00,00,00,00,1c,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,17,00,00,00,00,00,00,00,fe,80,00,00,00,\
      00,00,00,bd,0b,96,45,bc,c8,06,c5,15,00,00,00,00,00,00,00,17,00,00,00,00,00,\
      00,00,fe,80,00,00,00,00,00,00,bd,0b,96,45,bc,c8,06,c5,15,00,00,00,00,00,00,\
      00,17,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,ff,ff,c0,a8,6f,71,\
      00,00,00,00,00,00,00,00,1c,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,17,00,00,00,00,00,00,00,00,00,\
      00,00,00,00,00,00,00,00,ff,ff,c0,a8,89,01,00,00,00,00,00,00,00,00,02,00,00,\
      00,c0,a8,6f,71,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
      00,00,00,00,17,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,ff,ff,c0,\
      a8,b5,01,00,00,00,00,00,00,00,00,1c,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,24,00,00,24,2e,b2,00,\
      00,20,c4,1c,00,98,be,1c,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
      02,00,00,00,c0,a8,89,01,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,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,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,00,00,00,00,00,00,00,00,00,\
      00,00,00,02,00,00,00,c0,a8,b5,01,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,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,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,00,00,00,00,00,00,\
      00,00,00,00,00,00
    "SavedLegacySettings"=hex:46,00,00,00,b3,10,00,00,09,00,00,00,12,00,00,00,32,\
      32,32,2e,32,32,32,2e,32,32,32,2e,32,32,32,3a,38,30,07,00,00,00,3c,6c,6f,63,\
      61,6c,3e,00,00,00,00,04,00,00,00,00,00,00,00,90,67,15,04,42,9f,ca,01,00,00,\
      00,00,00,00,00,00,00,00,00,00,05,00,00,00,17,00,00,00,00,00,00,00,fe,80,00,\
      00,00,00,00,00,ad,8e,0a,11,97,66,b9,25,14,00,00,00,00,00,00,00,17,00,00,00,\
      00,00,00,00,fe,80,00,00,00,00,00,00,ad,8e,0a,11,97,66,b9,25,14,00,00,00,00,\
      00,00,00,1c,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,17,00,00,00,00,00,00,00,fe,80,00,00,00,00,00,\
      00,bd,0b,96,45,bc,c8,06,c5,15,00,00,00,00,00,00,00,17,00,00,00,00,00,00,00,\
      fe,80,00,00,00,00,00,00,bd,0b,96,45,bc,c8,06,c5,15,00,00,00,00,00,00,00,17,\
      00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,ff,ff,c0,a8,6f,71,00,00,\
      00,00,00,00,00,00,1c,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,17,00,00,00,00,00,00,00,00,00,00,00,\
      00,00,00,00,00,00,ff,ff,c0,a8,89,01,00,00,00,00,00,00,00,00,02,00,00,00,c0,\
      a8,6f,71,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
      00,00,17,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,ff,ff,c0,a8,b5,\
      01,00,00,00,00,00,00,00,00,1c,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,24,00,00,24,2e,b2,00,00,20,\
      c4,1c,00,98,be,1c,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,02,00,\
      00,00,c0,a8,89,01,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,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,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,00,00,00,00,00,00,00,00,00,00,00,\
      00,02,00,00,00,c0,a8,b5,01,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,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,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,00,00,00,00,00,00,00,00,\
      00,00,00,00
    "宽带连接"=hex:46,00,00,00,02,00,00,00,03,00,00,00,12,00,00,00,35,35,35,2e,35,35,\
      35,2e,35,35,35,2e,35,35,35,3a,38,30,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,00,00,\
      00,00

    到 “\” 结束但是每一行的长度和总长度如何确定?
    还是说我写入注册表时把这些看做一行进行输入?

    2010年1月29日 7:42
  • 2010年4月6日 5:10
    版主