NamedPipeClientStream Constructor (String^, String^, PipeAccessRights, PipeOptions, TokenImpersonationLevel, HandleInheritability)

 

Initializes a new instance of the NamedPipeClientStream class with the specified pipe and server names, and the specified pipe options, security impersonation level, and inheritability mode.

Namespace:   System.IO.Pipes
Assembly:  System.Core (in System.Core.dll)

public:
NamedPipeClientStream(
	String^ serverName,
	String^ pipeName,
	PipeAccessRights desiredAccessRights,
	PipeOptions options,
	TokenImpersonationLevel impersonationLevel,
	HandleInheritability inheritability
)

Parameters

serverName
Type: System::String^

The name of the remote computer to connect to, or "." to specify the local computer.

pipeName
Type: System::String^

The name of the pipe.

desiredAccessRights
Type: System.IO.Pipes::PipeAccessRights

One of the enumeration values that specifies the desired access rights of the pipe.

options
Type: System.IO.Pipes::PipeOptions

One of the enumeration values that determines how to open or create the pipe.

impersonationLevel
Type: System.Security.Principal::TokenImpersonationLevel

One of the enumeration values that determines the security impersonation level.

inheritability
Type: System.IO::HandleInheritability

One of the enumeration values that determines whether the underlying handle will be inheritable by child processes.

Exception Condition
ArgumentNullException

pipeName or serverName is null.

ArgumentException

pipeName or serverName is a zero-length string.

ArgumentOutOfRangeException

pipeName is set to "anonymous".

-or-

options is not a valid PipeOptions value.

-or-

impersonationLevel is not a valid TokenImpersonationLevel value.

-or-

inheritability is not a valid HandleInheritability value.

The pipe direction for this constructor is determined by the desiredAccessRights parameter. If the desiredAccessRights value is ReadData, the pipe direction will be In. If the value of desiredAccessRights is WriteData, the pipe direction will be Out. If the value of desiredAccessRights includes both ReadData and WriteData, the pipe direction will be InOut.

Demand

for full trust for the immediate caller. This member cannot be used by partially trusted code.

.NET Framework
Available since 3.5
Return to top
Show: