![if !IE]> <![endif]>
.NET, each application runs in an application domain under the control of a host. The host creates the application domain and loads assemblies into it. The host has access to information about the code via evidence. This information can include the zone in which the code originates or the digital signatures of the assemblies in the application domain. The System.AppDomain class provides the application domain functionality and is used by hosts. A host can be trusted if it provides the CLR with all the evidence the security policy requires.
There are several types of application hosts:
· Browser host-includes applications hosted by Microsoft Internet Explorer; runs code within the context of a Web site.
· Server host-regarding ASP.NET, refers to the host that runs the code that handles requests submitted to a server.
· Shell host-refers to a host that launches applications, namely .exe files, from the operating system shell.
· Custom-designed host-a host that creates domains or loads assemblies into domains (e.g., dynamic assemblies).
Running an Application with a Specific Evidence and Zone
String myApplication = @"C:\MyApp.exe"; String argsToApp = null;
String myURL = @"http://www.brainkart.com"; SecurityZone myZone = SecurityZone.Internet; Evidence myEvidence = new Evidence(); myEvidence.AddHost(new Zone(myZone)); myEvidence.AddHost(new Url(myURL));
AppDomain app = AppDomain.CreateDomain(myApplication, myEvidence); app.ExecuteAssembly(myApplication, myEvidence, argsToApp);
Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.