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's blog: http://danrandolph.blogspot.com/
Dan won with this fantastic contribution:
Named Pipes IO for Inter-process Communication
Visual C# Technical Guru - June 2013 |
| 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:
Thanks to Dan Randolph for your great contribution to the TechNet Guru contest! You can read about all the June winners here:
Also, for the August Guru competition, see TechNet Guru Contributions - August 2013
Are you a Wiki Ninja? http://technet.com/wiki
- User Ed