Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
260 views
in Technique[技术] by (71.8m points)

c# - Change Internet Explorer settings programmatically?

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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The "cheat" way to do this is to change the value

HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet Settingsones1609 HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet Settingsones11609 HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet Settingsones21609 HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet Settingsones31609 HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet Settingsones41609

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 call SetZoneActionPolicy to adjust the settings for URLACTION_HTML_MIXED_CONTENT in the zones you want to adjust.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...