Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Internet explorer 如何以编程方式禁用javascript_Internet Explorer_Registry - Fatal编程技术网

Internet explorer 如何以编程方式禁用javascript

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\

我可以在IE中禁用internet安全中的java脚本,但如何以编程方式实现呢?喜欢使用注册表项吗?

在C中,您可以这样做-

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()