惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Forbes - Security
Forbes - Security
GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
SegmentFault 最新的问题
Y
Y Combinator Blog
Recorded Future
Recorded Future
博客园 - Franky
I
InfoQ
T
The Blog of Author Tim Ferriss
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
T
Tailwind CSS Blog
Cyberwarzone
Cyberwarzone
The Register - Security
The Register - Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
雷峰网
雷峰网
P
Palo Alto Networks Blog
G
GRAHAM CLULEY
Cloudbric
Cloudbric
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
MongoDB | Blog
MongoDB | Blog
F
Full Disclosure
Google DeepMind News
Google DeepMind News
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
Check Point Blog
爱范儿
爱范儿
The GitHub Blog
The GitHub Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
T
Threat Research - Cisco Blogs
U
Unit 42
N
Netflix TechBlog - Medium
The Cloudflare Blog
Spread Privacy
Spread Privacy
Microsoft Azure Blog
Microsoft Azure Blog
美团技术团队
T
Troy Hunt's Blog
Engineering at Meta
Engineering at Meta
H
Heimdal Security Blog
TaoSecurity Blog
TaoSecurity Blog
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tenable Blog
B
Blog
S
Securelist
H
Hacker News: Front Page
Google Online Security Blog
Google Online Security Blog
G
Google Developers Blog

博客园 - 海盗

How to point your package manager to US server How to install Java in Ubuntu [Linux]Variable and Parameters in Bash - 海盗 HOWTO: Install chinese input One series article of Linux file system Reading notes of &lt;&gt; -- I <> - 海盗 - 博客园 Got two days' break New keyboard - 海盗 - 博客园 Some questions before learning ASP.net MVC framework Back again! JavaScript MD5 Encryption - 海盗 AJAX中的Back Button/Bookmarking问题和Nikhil Kothari的Atlas解决方案 My 50 favorite design resources 复杂域环境下通过.Net操作Active Directory经验点滴 关于C#中字段的初始化 关于namespace - 海盗 - 博客园 好久没来了! C#播放音乐
IE ToolBar
海盗 · 2006-06-25 · via 博客园 - 海盗

        IE是现在Windows平台下用的最多的浏览器,但微软提供的IE是那么朴实,以至于毫无特色,那么如何用程序来修改IE,打造有自己的特色的IE呢?我经过思索,通过注册表找到了修改IE的方法,下面我向大家介绍一下这种方法。
 
        首先我们来熟悉一下C#中修改注册表的方法与函数。在VC#中提供了Registry类、RegistryKey类来实现对注册表的操作。其中Registry类封装了注册表的七个基本主健:

    Registry.ClassesRoot 对应于HKEY_CLASSES_ROOT主键

    Registry.CurrentUser 对应于HKEY_CURRENT_USER主键

    Registry.LocalMachine 对应于 HKEY_LOCAL_MACHINE主键

Registry.User 对应于 HKEY_USER主键

    Registry.CurrentConfig 对应于HEKY_CURRENT_CONFIG主键

    Registry.DynDa 对应于HKEY_DYN_DATA主键

    Registry.PerformanceData 对应于HKEY_PERFORMANCE_DATA主键

    RegistryKey类封装了对注册表的基本操作,包括读取,写入,删除。其中读取的主要函数有:

    OpenSubKey ( string name )方法主要是打开指定的子键。

    GetSubKeyNames ( )方法是获得主键下面的所有子键的名称,它的返回值是一个字符串数组。

    GetValueNames ( )方法是获得当前子键中的所有的键名称,它的返回值也是一个字符串数组。

    GetValue ( string name )方法是指定键的键值。

    写入的函数有:

    CreateSubKey(string name)方法是增加一个子键

    SetValue(string name,string value)方法是设置一个键的键值

    删除的函数:

    DeleteSubKey ( )方法:删除一个指定的子键。

    DeleteSubKeyTree ( )方法:

    此方法是彻底删除指定的子键目录,即:删除该子键以及该子键以下的全部子键。

     通过注册表可以修改IE,在这里我简单的介绍几个常用的来实现对IE的修改。

    如果我们希望在打开或者关闭IE窗口时,被打开的窗口有动感效果,那么可以打开HKEY_ CURRENT_USER \ Control Panel\ desktop\ WindowMetrics键,并在右边的窗口中新建串值"Minanimat"与"Maxanimat"并设值为"0",为"1",这样在IE窗口最大最小化切换时有递变的效果。

    如果我们更改为IE的工具栏添加背景那么展开HKEY_Current_User\ Software\Microsoft\Internet Explorer\Toolbar键值,Explorer主键下新建一个名为"BackBitmap"的字符串值,并将其值修改为事先准备的BMP图片的完整路径及文件名;这样我们就完成了为IE的工具栏添加背景图片的目的。

    用C#编程来实现的方法如下:

1.IE窗口的动感效果 

     
//------------------------------------- 
    
// ChangeIE.cs ? 2004 by yudehui 
    
//------------------------------------- 
    using System; 
    
using Microsoft.Win32; //对注册表操作一定要引用这个命名空间 
    namespace ChangeIE
    

        
class ChangeIE 
            

            [STAThread] 
            
static void Main(string[] args) 
                

                    RegistryKey pregkey ; 
                       pregkey 
= Registry.CurrentUser.OpenSubKey("Control Panel\\Desktop\\WindowMetrics",true); 
                       
if (pregkey==null
                       

                          Console.WriteLine(
"键值不存在"); 
                       }
 
                       
else 
                      

                    pregkey.SetValue(
"MinAnimate","1"); 
                    pregkey.SetValue(
"MaxAnimate","1"); 
                   Console.WriteLine(
"修改成功"); 
               }
 
                pregkey. Close; 
            }
 
        }
 
    }
 

2.改变IE工具栏的背景 
    
//------------------------------------- 
    
// ChangeIE.cs ? 2004 by yudehui 
    
//------------------------------------- 
    using System; 
    
using Microsoft.Win32; //对注册表操作一定要引用这个命名空间
    namespace ChangeIEbackColor 
    

      
class ChangeIEbackColor 
        

           [STAThread] 
           
static void Main(string[] args) 
             

                RegistryKey pregkey ;
                pregkey 
= Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Internet" +  "Explorer\\Toolbar\\Explorer ",true); 
                
if (pregkey==null
                  

                     Console.WriteLine(
"键值不存在"); 
                  }
 
               
else 
                 

                    pregkey.SetValue(
"BackBitmap","C:\\windows\\Greenstone.bmp"); 
                    Console.WriteLine(
"修改成功"); 
                 }

              pregkey.Close; 
              }
 
          }
 
      }
 

    以上两个简单的例子只是对IE进行了简单的设定,相信大家对C#下对注册表的操作已经有了一定的了解。有兴趣的读者可以自己对IE进行更个性化的修改,以上代码在Windows2003+VS.NET2003下调试通过。

    注:在对注册表进行操作有一定的危险性,操作时要先进行备份,以防止误操作,而导致系统崩溃。