Turn off script debugger programmatically

  • Thread starter Thread starter Atul
  • Start date Start date
A

Atul

Hi,

How can I "disable script debugger" programmatically using C#? Its similar
action when we check the check box from IE (Tools | Internet Options...|
Advanced).

Any ideas???

Thanks
Atul
 
You can not do that (I am 99.9% sure), but you can use VB on error resume
next, or JavaScript try-catch to catch and handle all errors.

Best Regards

Anders Both
 
Well,
I got one way to do this.
Please find the attached C# code.

using Microsoft.Win32; //To manipulate registry settings to disable script
debugger

private void disableScriptDebugger()
{
RegistryKey regKey =
Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Internet
Explorer\\Main",true);
if (regKey != null)
{
try
{
string strChecked = (string)regKey.GetValue("Disable Script Debugger");
if (strChecked != null && strChecked.ToLower() != "yes")
regKey.SetValue("Disable Script Debugger","yes");
}
catch(Exception ex)
{
throw new ApplicationException(ex.Message,null);
}
}
}

Thanks
Atul
 
Back
Top