This documentation is archived and is not being maintained.

NetTcpSecurity.Mode Property

Gets or sets whether message-level and transport-level security are used by an endpoint configured with a NetTcpBinding.

Namespace: System.ServiceModel
Assembly: System.ServiceModel (in system.servicemodel.dll)

public SecurityMode Mode { get; set; }
/** @property */
public SecurityMode get_Mode ()

/** @property */
public void set_Mode (SecurityMode value)

public function get Mode () : SecurityMode

public function set Mode (value : SecurityMode)

Not applicable.

Property Value

A value of the SecurityMode that indicates whether message-level or transport-level security are used by an endpoint. The default value is Transport.

Exception typeCondition


The value is not defined.

The security mode determines the type of security required by an endpoint. Windows Communication Foundation (WCF) security offers a variety of mechanisms with which to secure the transfer of messages that are configured with the system-provided bindings. Each of the bindings supports a subset of these security modes. The mode determines the mechanisms by which message transfer security functions (integrity, confidentiality and authentication) are required.

NetTcpSecurity security = binding.Security;
Console.WriteLine("\tSecurity Mode: {0}", security.Mode);

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, 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