NamedPipeClientStream Constructor (String^, String^, PipeDirection)

 

Initializes a new instance of the NamedPipeClientStream class with the specified pipe and server names, and the specified pipe direction.

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

public:
NamedPipeClientStream(
	String^ serverName,
	String^ pipeName,
	PipeDirection direction
)

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.

direction
Type: System.IO.Pipes::PipeDirection

One of the enumeration values that determines the direction of the pipe.

Exception Condition
ArgumentNullException

pipeName or serverName is null.

ArgumentException

pipeName or serverName is a zero-length string.

ArgumentOutOfRangeException

pipeName is set to "anonymous".

-or-

direction is not a valid PipeDirection value.

This constructor uses the following default values:

The following example demonstrates a method to send a string from a parent process to a child process using named pipes. This example creates a NamedPipeClientStream object in a child process, which then connects to a pipe on the local computer. The server example can be seen in the NamedPipeServerStream class. This example is part of a larger example provided for the NamedPipeServerStream and NamedPipeClientStream classes.

No code example is currently available or this language may not be supported.

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: