本文整理汇总了C#中System.IO.Pipes.NamedPipeClientStream.GetMessages方法的典型用法代码示例。如果您正苦于以下问题:C# NamedPipeClientStream.GetMessages方法的具体用法?C# NamedPipeClientStream.GetMessages怎么用?C# NamedPipeClientStream.GetMessages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.Pipes.NamedPipeClientStream
的用法示例。
在下文中一共展示了NamedPipeClientStream.GetMessages方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
var c1 =
from f in System.IO.Directory.GetFiles(
"C:\\Users\\Octavio\\Pictures", "*.jpg",
SearchOption.AllDirectories)
where f.ToUpper().Contains("DIANA")
orderby f
select f.ToUpper();
DirectoryInfo dirInfo =
new System.IO.DirectoryInfo("C:\\Users\\Octavio\\Pictures");
var c2 =
from f in dirInfo.GetFiles("*.jpg", SearchOption.AllDirectories)
where f.Length > 10240
orderby f.CreationTime descending
select f.FullName.ToUpper();
var c3 =
from f in dirInfo.GetFileInfos("*.jpg", true)
where f.Length > 10240
orderby f.CreationTime descending
select f.FullName.ToUpper();
foreach (var c in c3)
Console.WriteLine(c);
// *** CLIENTE
//Decoder decoder = Encoding.UTF8.GetDecoder();
//Byte[] bytes = new Byte[10];
//Char[] chars = new Char[10];
//using (NamedPipeClientStream pipeStream =
// new NamedPipeClientStream(".", "CS3", PipeDirection.InOut))
//{
// pipeStream.Connect();
// pipeStream.ReadMode = PipeTransmissionMode.Message;
// int numBytes;
// do
// {
// string message = "";
// do
// {
// numBytes = pipeStream.Read(bytes, 0, bytes.Length);
// int numChars = decoder.GetChars(bytes, 0, numBytes, chars, 0);
// message += new String(chars, 0, numChars);
// } while (!pipeStream.IsMessageComplete);
// decoder.Reset();
// Console.WriteLine(message);
// } while (numBytes != 0);
//}
using (NamedPipeClientStream pipeStream =
new NamedPipeClientStream(".", "CS3", PipeDirection.InOut))
{
var entrada = from s in pipeStream.GetMessages()
where string.Compare(s, "3") < 0
orderby s
select s;
foreach (var s in entrada)
Console.WriteLine(s);
}
}