How to use code to set operations in IE and FF to change the Script or JavaScript status in IE, whether it is disabled or enabled. The following articles do not support other browsers.
Currently, two solutions are available (IE is used as an example)
First, use an automated tool to capture the process id of IE, capture the files, tools, and menu items of IE, click and capture them step by step, and then click and save them.
Second, write code, modify existing resources that can be changed, and read and modify the status.
For the above two solutions, this article only implements the latter because the automation tools required by the former are hard to determine. Even if it is determined, it takes some time to configure the environment and read the documentation, familiar with those dll and so on, this will take a lot of time. The latter solution saves time.
IE
Registry details: http://support.microsoft.com/kb/182569
Some of the following content is mentioned in the Registry key description of Internet Explorer, so we can modify the options in the Registry to meet our expectation.
Vcj0 = "# ff0000"> // <summary>
/// Get Current Script state of IE.
/// </Summary>
/// <Param name = "regPath"> </param>
/// <Returns> true ---> allow Script. </returns>
Public static bool GetIECurrentScriptState (string regPath)
{
Bool ret = false;
RegistryKey regSubkey = null;
RegSubkey = Registry. CurrentUser. OpenSubKey (regPath, true );
If (regSubkey. GetValue ("1400"). ToString () = "0 ")
{
Ret = true;
}
If (int) regSubkey. GetValue ("1400") = 3)
{
Ret = false;
}
Return ret;
}