Rockford Lhotka
    CTO at Magenic
    Author, speaker, software architect
    Creator of the CSLA .NET framework

Home
Blog
CSLA .NET
Magenic
Speaking
Publications
About me
Contact me

Login

Determining IE security zone for a URL

 

You can determine the IE security zone for a specific URL with the following code. The resulting SecurityZone value is an enumerated type which includes all the zones defined by the .NET runtime.

Dim AppURL As String = "http://server/root/page.aspx"
Dim zone As System.Security.Policy.Zone
 
zone = System.Security.Policy.Zone.CreateFromUrl(AppURL)
 
If zone.SecurityZone = SecurityZone.Intranet Then
  ' do Intranet-specific process
End If
 

(Updated 4/2/2003)