»áÔ±£º ÃÜÂ룺 ¡¡Ãâ·Ñ×¢²á | Íü¼ÇÃÜÂë | »áÔ±µÇ¼ ÍøÒ³¹¦ÄÜ£º ¼ÓÈëÊÕ²Ø ÉèΪÊ×Ò³ ÍøÕ¾ËÑË÷  
¼¼ÊõÎĵµ > C#.Net
ÓÃC#´òÔì¸öÐÔ»¯µÄIEä¯ÀÀÆ÷
·¢±íÈÕÆÚ£º2005-01-28 23:30:31×÷ÕߣºÓ ³ö´¦£ºASPCOOL  

    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 ( )·½·¨£º

    ´Ë·½·¨Êdz¹µ×ɾ³ýÖ¸¶¨µÄ×Ó¼üĿ¼£¬¼´£ºÉ¾³ý¸Ã×Ó¼üÒÔ¼°¸Ã×Ó¼üÒÔϵÄÈ«²¿×Ó¼ü¡£

     ͨ¹ý×¢²á±í¿ÉÒÔÐÞ¸Ä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("Ð޸ijɹ¦");
               }
                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("Ð޸ijɹ¦");
                 }
              pregkey.Close;
              }
          }
      }

    ÒÔÉÏÁ½¸ö¼òµ¥µÄÀý×ÓÖ»ÊǶÔIE½øÐÐÁ˼òµ¥µÄÉ趨£¬ÏàÐÅ´ó¼Ò¶ÔC#϶Ô×¢²á±íµÄ²Ù×÷ÒѾ­ÓÐÁËÒ»¶¨µÄÁ˽⡣ÓÐÐËȤµÄ¶ÁÕß¿ÉÒÔ×Ô¼º¶ÔIE½øÐиü¸öÐÔ»¯µÄÐ޸ģ¬ÒÔÉÏ´úÂëÔÚWindows2003+VS.NET2003ϵ÷ÊÔͨ¹ý¡£

    ×¢£ºÔÚ¶Ô×¢²á±í½øÐвÙ×÷ÓÐÒ»¶¨µÄΣÏÕÐÔ£¬²Ù×÷ʱҪÏȽøÐб¸·Ý£¬ÒÔ·ÀÖ¹Îó²Ù×÷£¬¶øµ¼ÖÂϵͳ±ÀÀ£¡£

 

¡¾·µ»Ø¶¥²¿¡¿ ¡¾´òÓ¡±¾Ò³¡¿ ¡¾¹Ø±Õ´°¿Ú¡¿

¹ØÓÚÎÒÃÇ / ¸øÎÒÁôÑÔ / °æȨ¾Ù±¨ / Òâ¼û½¨Òé / ÍøÕ¾±à³ÌQQȺ   
Copyright ©2003- 2024 Lihuasoft.net webmaster(at)lihuasoft.net ¼ÓÔØʱ¼ä 0.00416