Export (0) Print
Expand All

SmtpPermission.AddPermission Method

Adds the specified access level value to the permission.

Namespace: System.Net.Mail
Assembly: System (in system.dll)

public void AddPermission (
	SmtpAccess access
)
public void AddPermission (
	SmtpAccess access
)
public function AddPermission (
	access : SmtpAccess
)
Not applicable.

Parameters

access

One of the SmtpAccess values.

Use this method to modify access to Simple Mail Transport Protocol servers by adding to the state of this permission instance.

The following code example adds Connect access to a permission object.

public static SmtpPermission GiveFullAccess(SmtpPermission permission)
{
    permission.AddPermission(SmtpAccess.Connect);
    return permission;
}

public static SmtpPermission GiveFullAccess(SmtpPermission permission)
{
    permission.AddPermission(SmtpAccess.Connect);
    return permission;
} //GiveFullAccess

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2015 Microsoft