本文整理汇总了VB.NET中System.IO.Pipes.NamedPipeClientStream.NumberOfServerInstances属性的典型用法代码示例。如果您正苦于以下问题:VB.NET NamedPipeClientStream.NumberOfServerInstances属性的具体用法?VB.NET NamedPipeClientStream.NumberOfServerInstances怎么用?VB.NET NamedPipeClientStream.NumberOfServerInstances使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.IO.Pipes.NamedPipeClientStream
的用法示例。
在下文中一共展示了NamedPipeClientStream.NumberOfServerInstances属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: PipeClient
' 导入命名空间
Imports System.IO
Imports System.IO.Pipes
Imports System.Security.Principal
Class PipeClient
Shared Sub Main(ByVal args As String())
Dim pipeClient As New NamedPipeClientStream("localhost", _
"testpipe", PipeDirection.In, PipeOptions.None)
' Connect to the pipe or wait until the pipe is available.
Console.WriteLine("Attempting to connect to the pipe...")
pipeClient.Connect()
Console.WriteLine("Connect to the pipe.")
Console.WriteLine("There are currently {0} pipe server instances open.", _
pipeClient.NumberOfServerInstances)
Dim sr As New StreamReader(pipeClient)
Dim temp As String
temp = sr.ReadLine()
While Not temp Is Nothing
Console.WriteLine("Received from server: {0}", temp)
temp = sr.ReadLine()
End While
Console.Write("Press Enter to continue...")
Console.ReadLine()
End Sub
End Class