在IE中,我可以在网络安全中禁用java脚本。但是如何通过编程来实现呢?比如使用注册表项?
发布于 2015-08-29 15:35:26
在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中使用简单命令
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /t REG_DWORD /v 1400 /d 3 /f注:启用在CommandPrompt中使用-> /d 0
或
C#中的"1400“、"0”
发布于 2017-07-13 00:54:15
在VBA中可以这样做:
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()https://stackoverflow.com/questions/28622225
复制相似问题