By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,740 Members | 790 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,740 IT Pros & Developers. It's quick & easy.

IE Intranet zone > Require server verification ... How to check programaticaly ?

P: n/a
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

Dec 1 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
Dec 3 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.