Internet explorer 如何以编程方式禁用javascript
我可以在IE中禁用internet安全中的java脚本,但如何以编程方式实现呢?喜欢使用注册表项吗?在C中,您可以这样做-Internet explorer 如何以编程方式禁用javascript,internet-explorer,registry,Internet Explorer,Registry,我可以在IE中禁用internet安全中的java脚本,但如何以编程方式实现呢?喜欢使用注册表项吗?在C中,您可以这样做- private void UpdateDataSource() { RegistryKey ChangeSettings = Registry.CurrentUser.OpenSubKey(@"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\
private void UpdateDataSource()
{
RegistryKey ChangeSettings = Registry.CurrentUser.OpenSubKey(@"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3", true);
// "Active Scripting" - "Disable"
ChangeSettings.SetValue("1400", "3", RegistryValueKind.DWord);
ChangeSettings.Close();
}
//------或者在CommandPrompt中使用简单命令------//
注意:要在CommandPrompt中启用使用->/d 0
或
VBA中C#中的“1400”、“0”可以执行以下操作:
sub tst()
Dim wsh As IWshRuntimeLibrary.WshShell
Set wsh = New IWshRuntimeLibrary.WshShell
wsh.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersi\Internet Settings\Zones\3\1400", "0", "REG_DWORD"
end sub()
可能是的,但您不能通过任意网页访问注册表。否。没有用于更新用户本地设置的文档化API。此外,由于用户帐户控制和其他完整性保护,这将变得复杂。
sub tst()
Dim wsh As IWshRuntimeLibrary.WshShell
Set wsh = New IWshRuntimeLibrary.WshShell
wsh.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersi\Internet Settings\Zones\3\1400", "0", "REG_DWORD"
end sub()