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


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 Randolph Named Pipes IO for Inter-process Communication Christian 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.

private void button1_Click(object sender, RoutedEventArgs e)
{
  using (NamedPipeClientStream pipeClient = new NamedPipeClientStream(".", "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 = new StreamWriter(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

Comments (1)

  1. Hezequias Vasconcelos says:

    Congratulations Dan. Very good job.

Skip to main content