由网友(迷离灯光暧昧情调)分享简介:如何在C#应用程序中创建命名管道中的.NET 4?How to create NAMED-PIPE in .NET-4 in your C# application?推荐答案下面是一张code创建一个命名管道客户端,它是从一个答案,一个$p$pvious问题我回答了基于C之间的通讯++和C#使用命名管道Here...
如何在C#应用程序中创建命名管道中的.NET 4?
How to create NAMED-PIPE in .NET-4 in your C# application?
推荐答案
下面是一张code创建一个命名管道客户端,它是从一个答案,一个$p$pvious问题我回答了基于C之间的通讯++和C#使用命名管道
Here is a piece of code to create a Named Pipe client, it is lifted from an answer to a previous question I answered on communicating between C++ and C# using Named Pipes
using System;
using System.Text;
using System.IO;
using System.IO.Pipes;
namespace CSPipe
{
class Program
{
static void Main(string[] args)
{
NamedPipeClientStream pipe = new NamedPipeClientStream(".", "HyperPipe", PipeDirection.InOut);
pipe.Connect();
using (StreamReader rdr = new StreamReader(pipe, Encoding.Unicode))
{
System.Console.WriteLine(rdr.ReadToEnd());
}
Console.ReadKey();
}
}
}
相关推荐
最新文章