Google了下【C# Change Internet Explorer settings】,运气很好,第一个就是,通过注册表可以修改


Any idea how do I do the following using C#?

  1. Going to Tools -> Internet Options -> Security
  2. Select the Security tab
  3. Click the Custom Level button
  4. In the Miscellaneous section change Display mixed content to Enable

The “cheat” way to do this is to change the value

    1. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\0\1609
    2. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\1\1609
    3. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2\1609
    4. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\1609
    5. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\4\1609

Where 0-4 are Zone identifiers and the value is 0 to Allow, 1 to Prompt, and 3 to Block. Keep in mind that if your code does this on anyone’s machine but your own, you’re likely to find your code blocked as malware.

The “proper” way to do this is to use the APIs to create an IInternetZoneManager and callSetZoneActionPolicy to adjust the settings for URLACTION_HTML_MIXED_CONTENT in the zones you want to adjust.




电子邮件地址不会被公开。 必填项已用*标注