I'm using a text which sets the AppDomain evidence (as variable e) with the following code:
1. Zone safeZone = new Zone(SecurityZone.Internet); 2. object[] hostEvidence = { new Zone(SecurityZone.Internet) }; 3. Evidence e = new Evidence(hostEvidence, null);4. AppDomain d = AppDomain.CreateDomain("New Domain", e);
5. d.ExecuteAssemblyByName("ShowBootIni");
My Question is, what is the purpose of the first line: Zone safeZone = new Zone(SecurityZone.Internet);, I don't seem to be using the variable 'safeZone' anywhere else in the code, but it functions as described. Is this line even essential or does the 2nd line defining the object hostEvidence provide everything I need Thanks
~ Chris

AppDomain Evidence declaration question
Speedmaster
Hi Chris,
if you are not using the variable anywhere in your code then it is safe to remove. Maybe wherever you got the code sample from originally had been refactored but this variable was not taken out, but maybe it was originally passed into the hostEvidence object array instead of there being a new Zone(... statement there.
Mark.