Editare

Partajați prin


NamedPipeServerStreamAcl.Create Method

Definition

Creates a new instance of the NamedPipeServerStream class with the specified pipe name, pipe direction, maximum number of server instances, transmission mode, pipe options, recommended in and out buffer sizes, pipe security, inheritability mode, and pipe access rights.

public static System.IO.Pipes.NamedPipeServerStream Create (string pipeName, System.IO.Pipes.PipeDirection direction, int maxNumberOfServerInstances, System.IO.Pipes.PipeTransmissionMode transmissionMode, System.IO.Pipes.PipeOptions options, int inBufferSize, int outBufferSize, System.IO.Pipes.PipeSecurity? pipeSecurity, System.IO.HandleInheritability inheritability = System.IO.HandleInheritability.None, System.IO.Pipes.PipeAccessRights additionalAccessRights = (System.IO.Pipes.PipeAccessRights) 0);
static member Create : string * System.IO.Pipes.PipeDirection * int * System.IO.Pipes.PipeTransmissionMode * System.IO.Pipes.PipeOptions * int * int * System.IO.Pipes.PipeSecurity * System.IO.HandleInheritability * System.IO.Pipes.PipeAccessRights -> System.IO.Pipes.NamedPipeServerStream
Public Shared Function Create (pipeName As String, direction As PipeDirection, maxNumberOfServerInstances As Integer, transmissionMode As PipeTransmissionMode, options As PipeOptions, inBufferSize As Integer, outBufferSize As Integer, pipeSecurity As PipeSecurity, Optional inheritability As HandleInheritability = System.IO.HandleInheritability.None, Optional additionalAccessRights As PipeAccessRights = (System.IO.Pipes.PipeAccessRights) 0) As NamedPipeServerStream

Parameters

pipeName
String

The name of the pipe.

direction
PipeDirection

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

maxNumberOfServerInstances
Int32

The maximum number of server instances that share the same name. You can pass MaxAllowedServerInstances for this value.

transmissionMode
PipeTransmissionMode

One of the enumeration values that determines the transmission mode of the pipe.

options
PipeOptions

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

inBufferSize
Int32

The input buffer size.

outBufferSize
Int32

The output buffer size.

pipeSecurity
PipeSecurity

An object that determines the access control and audit security for the pipe.

inheritability
HandleInheritability

One of the enumeration values that determines whether the underlying handle can be inherited by child processes.

additionalAccessRights
PipeAccessRights

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

Returns

A new named pipe server stream instance.

Exceptions

pipeName is null.

pipeName is empty.

options is None.

options contains an invalid flag.

-or-

inBufferSize or outBufferSize is less than zero.

-or-

maxNumberOfServerInstances is not a valid number: it should be greater than or equal to 1 and less than or equal to 254, or should be set to the value of MaxAllowedServerInstances.

-or-

inheritability contains an invalid enum value.

-or-

pipeName is 'anonymous', which is reserved.

Remarks

If options contains CurrentUserOnly, the passed pipeSecurity is ignored and the returned NamedPipeServerStream object is created using a custom PipeSecurity instance assigned to the current Windows user as its only owner with full control of the pipe.

Applies to