I have an application that behaves oddly, and just to verify, I\'d like to see which security zone it is currently running under.
I\'ve found the System.Security.Sec
In .NET 3.5 you can simplify the code with LINQ:
Zone z = a.Evidence.OfType().First();
From .NET 4.0 you have a convenient GetHostEvidence
method:
Zone z = Assembly.GetExecutingAssembly().Evidence.GetHostEvidence();
Note that from .NET 4.0 evidence classes derive from the EvidenceBase
base class.
HTH, György