Solution :
public bool SetHttpsIeZone(bool value,int ie_zone)
{
RegistryKey key = Registry.CurrentUser.OpenSubKey(
@"Software\Microsoft\Windows\CurrentVersion\Intern et
Settings\Zones\" + ie_zone.ToString(),true);
Int32 keyValue = (Int32)key.GetValue("Flags");
//Le bit du flag qui gere cette protection est le 6eme
//On va convertir la valeur du flag en binaire, l'exploser
dans un tableau de char et le reconstruire
string binString = Convert.ToString(keyValue, 2);
char[] binChar = binString.ToCharArray();
if (value) { binChar[5] = (char)49; }
if (!value) { binChar[5] = (char)48; }
string newBinString = new string(binChar,0,binChar.Length);
int newKey = Convert.ToInt32(newBinString, 2);
key.SetValue("Flags", newKey,RegistryValueKind.DWord);
key.Flush();
key.Close();
return true;
}
gbraux a écrit :
Hello,
I am dealing with security zones in Internet Explorer.
I know how to add websites programaticaly to the intranet zone (using
IInternetSecurityManager::SetZoneMapping).
But do anyone know how to check/uncheck programaticaly the "Require
server verification (https:) from all sites in this zone" ?
I looked all over MSDN, but do not find a function dealing with this
...
Thanks,
Guillaume BRAUX