470,647 Members | 1,193 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,647 developers. It's quick & easy.

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

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
1 8663
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.

Similar topics

17 posts views Thread by Jawahar Rajan | last post: by
4 posts views Thread by Vikas Kumar | last post: by
reply views Thread by warner | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.