SmtpPermission.Union(IPermission) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a permission that is the union of the current permission and the specified permission.
public:
override System::Security::IPermission ^ Union(System::Security::IPermission ^ target);
public override System.Security.IPermission Union (System.Security.IPermission target);
override this.Union : System.Security.IPermission -> System.Security.IPermission
Public Overrides Function Union (target As IPermission) As IPermission
Parameters
- target
- IPermission
An IPermission to combine with the current permission.
Returns
A new SmtpPermission permission that represents the union of the current permission and the specified permission.
Exceptions
target
is not an SmtpPermission.
Examples
The following example creates a permission object that is the union of two permission objects.
static SmtpPermission^ UnionWithFull(
SmtpPermission^ permission)
{
SmtpPermission^ allAccess =
gcnew SmtpPermission(PermissionState::Unrestricted);
return (SmtpPermission^) permission->Union(allAccess);
}
public static SmtpPermission UnionWithFull(SmtpPermission permission)
{
SmtpPermission allAccess = new
SmtpPermission(System.Security.Permissions.PermissionState.Unrestricted);
return (SmtpPermission) permission.Union(allAccess);
}
Remarks
The Union method returns a permission that represents all the states represented by both the current permission and the specified permission. Any demand that passes either permission passes their union.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기