Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

HostProtectionAttribute::Resources Property


Gets or sets flags specifying categories of functionality that are potentially harmful to the host.

Namespace:   System.Security.Permissions
Assembly:  mscorlib (in mscorlib.dll)

property HostProtectionResource Resources {
	HostProtectionResource get();
	void set(HostProtectionResource value);

Property Value

Type: System.Security.Permissions::HostProtectionResource

A bitwise combination of the HostProtectionResource values. The default is None.

The HostProtectionResource flags specify the resources exposed by the method or class that are potentially harmful to the host.

The following code example illustrates the use of the HostProtectionAttribute attribute with the Resources property. This example is part of a larger example provided for the HostProtectionAttribute class.

// Use the enumeration flags to indicate that this method exposes shared state and 
// self-affecting process management.
// Either of the following attribute statements can be used to set the 
// resource flags.
// Exit the sample when an exception is thrown.

static void Exit( String^ Message, int Code )
   Console::WriteLine( "\nFAILED: {0} {1}", Message, Code );
   Environment::ExitCode = Code;
   Environment::Exit( Code );

.NET Framework
Available since 2.0
Return to top
© 2016 Microsoft