Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to add website into compatibility view ?

How to add website into compatibility view ?

Scheduled Pinned Locked Moved C#
csharpcomwindows-adminhelptutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    namerg
    wrote on last edited by
    #1

    Hello, I am not an expert in C# but this site helped a lot creating a mini application that launches IE9, modifies some registry keys and bingo. Now, I have to add a few modifications but launch IE11. This is the code:

    //Select the RegistryHive you wish to read from
    RegistryKey key00 = RegistryKey.OpenRemoteBaseKey(RegistryHive.CurrentUser, "");

            //Select the path within the hive
            RegistryKey subkeyAA = key00.OpenSubKey("Software\\\\Microsoft\\\\Internet Explorer\\\\BrowserEmulation\\\\ClearableListData", true);
            string\[\] namesAA = subkeyAA.GetValueNames();
            string YesUserFilter = "";
            string NoUserFilter = "";
    
            foreach (string name in namesAA)
            {
                if (name.Equals("UserFilter", StringComparison.CurrentCulture))
                {
                    // Found UserFilter
                    YesUserFilter = "1";                
                    break;
                }
                else
                {
                    // No Found UserFilter
                    NoUserFilter = "1";
                }
            }
            if (YesUserFilter == "1")
            {
                int myValue = (int)subkeyAA.GetValue("UserFilter");
                if (myValue != 0)
                {
                    //Console.WriteLine("Setting the right GE Recommendation");
                    subkeyAA.SetValue("UserFilter", "company.com", RegistryValueKind.Binary);
    
                }
            }
            if (NoUserFilter == "1")
            {
                //Console.WriteLine("Setting the right GE Recommendation");
                subkeyAA.SetValue("UserFilter", "company.com", RegistryValueKind.Binary);
    
            }
            subkeyAA.Close();
    

    But the conditionals of YesUserFilter or NoUserFilter are blank, Thoughts ? Thanks for your help.

    P N S 3 Replies Last reply
    0
    • N namerg

      Hello, I am not an expert in C# but this site helped a lot creating a mini application that launches IE9, modifies some registry keys and bingo. Now, I have to add a few modifications but launch IE11. This is the code:

      //Select the RegistryHive you wish to read from
      RegistryKey key00 = RegistryKey.OpenRemoteBaseKey(RegistryHive.CurrentUser, "");

              //Select the path within the hive
              RegistryKey subkeyAA = key00.OpenSubKey("Software\\\\Microsoft\\\\Internet Explorer\\\\BrowserEmulation\\\\ClearableListData", true);
              string\[\] namesAA = subkeyAA.GetValueNames();
              string YesUserFilter = "";
              string NoUserFilter = "";
      
              foreach (string name in namesAA)
              {
                  if (name.Equals("UserFilter", StringComparison.CurrentCulture))
                  {
                      // Found UserFilter
                      YesUserFilter = "1";                
                      break;
                  }
                  else
                  {
                      // No Found UserFilter
                      NoUserFilter = "1";
                  }
              }
              if (YesUserFilter == "1")
              {
                  int myValue = (int)subkeyAA.GetValue("UserFilter");
                  if (myValue != 0)
                  {
                      //Console.WriteLine("Setting the right GE Recommendation");
                      subkeyAA.SetValue("UserFilter", "company.com", RegistryValueKind.Binary);
      
                  }
              }
              if (NoUserFilter == "1")
              {
                  //Console.WriteLine("Setting the right GE Recommendation");
                  subkeyAA.SetValue("UserFilter", "company.com", RegistryValueKind.Binary);
      
              }
              subkeyAA.Close();
      

      But the conditionals of YesUserFilter or NoUserFilter are blank, Thoughts ? Thanks for your help.

      P Offline
      P Offline
      phil o
      wrote on last edited by
      #2

      Hi, The first thing I would look at is the MissingManifestResourceException. It seems that, in your WindowsFormsApplication1 project, there's a problem with a resource file. There can be several causes; could you check that, for every .resx file in your project, there is a .designer.cs file associated? Is Form1 marked as localizable? If so, there must also exist some relative resource files. Another thing to do would be to put a beakpoint on the first line of Form1's constructor, and pressing F11 line by line to find which one, in InitializeComponent() method, throws the exception. Hope this helps.

      There are two kinds of people in the world: those who can extrapolate from incomplete data.

      N 1 Reply Last reply
      0
      • P phil o

        Hi, The first thing I would look at is the MissingManifestResourceException. It seems that, in your WindowsFormsApplication1 project, there's a problem with a resource file. There can be several causes; could you check that, for every .resx file in your project, there is a .designer.cs file associated? Is Form1 marked as localizable? If so, there must also exist some relative resource files. Another thing to do would be to put a beakpoint on the first line of Form1's constructor, and pressing F11 line by line to find which one, in InitializeComponent() method, throws the exception. Hope this helps.

        There are two kinds of people in the world: those who can extrapolate from incomplete data.

        N Offline
        N Offline
        namerg
        wrote on last edited by
        #3

        Thank you i think i figured it out

        1 Reply Last reply
        0
        • N namerg

          Hello, I am not an expert in C# but this site helped a lot creating a mini application that launches IE9, modifies some registry keys and bingo. Now, I have to add a few modifications but launch IE11. This is the code:

          //Select the RegistryHive you wish to read from
          RegistryKey key00 = RegistryKey.OpenRemoteBaseKey(RegistryHive.CurrentUser, "");

                  //Select the path within the hive
                  RegistryKey subkeyAA = key00.OpenSubKey("Software\\\\Microsoft\\\\Internet Explorer\\\\BrowserEmulation\\\\ClearableListData", true);
                  string\[\] namesAA = subkeyAA.GetValueNames();
                  string YesUserFilter = "";
                  string NoUserFilter = "";
          
                  foreach (string name in namesAA)
                  {
                      if (name.Equals("UserFilter", StringComparison.CurrentCulture))
                      {
                          // Found UserFilter
                          YesUserFilter = "1";                
                          break;
                      }
                      else
                      {
                          // No Found UserFilter
                          NoUserFilter = "1";
                      }
                  }
                  if (YesUserFilter == "1")
                  {
                      int myValue = (int)subkeyAA.GetValue("UserFilter");
                      if (myValue != 0)
                      {
                          //Console.WriteLine("Setting the right GE Recommendation");
                          subkeyAA.SetValue("UserFilter", "company.com", RegistryValueKind.Binary);
          
                      }
                  }
                  if (NoUserFilter == "1")
                  {
                      //Console.WriteLine("Setting the right GE Recommendation");
                      subkeyAA.SetValue("UserFilter", "company.com", RegistryValueKind.Binary);
          
                  }
                  subkeyAA.Close();
          

          But the conditionals of YesUserFilter or NoUserFilter are blank, Thoughts ? Thanks for your help.

          N Offline
          N Offline
          namerg
          wrote on last edited by
          #4

          I fixed that part i had to change the string name variable to something else, it was bringing another value from the top. But on this section: subkeyAA.SetValue("UserFilter", "company.com", RegistryValueKind.Binary);

          I get ArgumentException was unhandled {"The type of the value object did not match the specified RegistryValueKind or the object could not be properly converted."}

          1 Reply Last reply
          0
          • N namerg

            Hello, I am not an expert in C# but this site helped a lot creating a mini application that launches IE9, modifies some registry keys and bingo. Now, I have to add a few modifications but launch IE11. This is the code:

            //Select the RegistryHive you wish to read from
            RegistryKey key00 = RegistryKey.OpenRemoteBaseKey(RegistryHive.CurrentUser, "");

                    //Select the path within the hive
                    RegistryKey subkeyAA = key00.OpenSubKey("Software\\\\Microsoft\\\\Internet Explorer\\\\BrowserEmulation\\\\ClearableListData", true);
                    string\[\] namesAA = subkeyAA.GetValueNames();
                    string YesUserFilter = "";
                    string NoUserFilter = "";
            
                    foreach (string name in namesAA)
                    {
                        if (name.Equals("UserFilter", StringComparison.CurrentCulture))
                        {
                            // Found UserFilter
                            YesUserFilter = "1";                
                            break;
                        }
                        else
                        {
                            // No Found UserFilter
                            NoUserFilter = "1";
                        }
                    }
                    if (YesUserFilter == "1")
                    {
                        int myValue = (int)subkeyAA.GetValue("UserFilter");
                        if (myValue != 0)
                        {
                            //Console.WriteLine("Setting the right GE Recommendation");
                            subkeyAA.SetValue("UserFilter", "company.com", RegistryValueKind.Binary);
            
                        }
                    }
                    if (NoUserFilter == "1")
                    {
                        //Console.WriteLine("Setting the right GE Recommendation");
                        subkeyAA.SetValue("UserFilter", "company.com", RegistryValueKind.Binary);
            
                    }
                    subkeyAA.Close();
            

            But the conditionals of YesUserFilter or NoUserFilter are blank, Thoughts ? Thanks for your help.

            S Offline
            S Offline
            seemajoshii
            wrote on last edited by
            #5

            I also facing the same issue in the coding.. Can anyone help out in this issue

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups