Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 34890

June C# Guru - Dan Randolph brings us "Named Pipes IO for Inter-process Communication"

$
0
0

It's time for another TechNet Guru winner!

Congratulations to Dan Randolph, our VB Guru winner for June 2013! To find all the competitors for June (and more information about this monthly contest), see the Wiki article: TechNet Guru Contributions for June 2013.

 

Dan Randolph's avatar

Dan's blog: http://danrandolph.blogspot.com/ 

  

Dan won with this fantastic contribution:

Named Pipes IO for Inter-process Communication

 

 

Guru Award Visual C# Technical Guru - June 2013  

Gold Award Winner

 

Dan RandolphNamed Pipes IO for Inter-process CommunicationChristian Lukito: "Good proof of concept showing how to use the API. But it will be more better if can provide real worlds example in what way this is more useful." 
Ed Price: "Very clear and easy to read! Great code snippets with good formatting!"

 

We've got new blood for the Visual C# category! Let's see what happens with the July contributions.

 

Here's an excerpt from the article:

 

PipeClient

Here is the button1_Click code snippet from the client project. All of the work in the demo client is done on the button click. A StreamWriter is simply connected to the NamedPipeClientStream, and the contents of the Textblock are written to the pipe stream for each button click.

privatevoid button1_Click(object sender, RoutedEventArgs e)
{
  using(NamedPipeClientStream pipeClient = newNamedPipeClientStream(".", "testpipe",
                                              PipeDirection.Out,
                                                 PipeOptions.Asynchronous))
  {
    tbStatus.Text = "Attempting to connect to pipe...";
    try
    {
      pipeClient.Connect(2000);
    }
    catch
    {
      MessageBox.Show("The Pipe server must be started in order to send data to it.");
      return;
    }
    tbStatus.Text = "Connected to pipe.";
    using(StreamWriter sw = newStreamWriter(pipeClient))
    {
      sw.WriteLine(tbClientText.Text);
    }
  }
  tbStatus.Text = "";
}

 

 

==================

 

Read the rest here:

Named Pipes IO for Inter-process Communication

 

Thanks to Dan Randolph for your great contribution to the TechNet Guru contest! You can read about all the June winners here: TechNet Guru Award Winners - June 2013

 

Also, for the August Guru competition, see TechNet Guru Contributions - August 2013. The judges are going through the July entries now! 

   

Are you a Wiki Ninja? http://technet.com/wiki

    - User Ed


Viewing all articles
Browse latest Browse all 34890

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>