Click here to Skip to main content
15,905,563 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
All greetings! Need help ...:confused:

There is a Named Pipe process called "The Bat!"
Question: How correctly through. NET Framwork, send in the thread some text that will be the command for the specified process?
I tried this way:

using System.IO.Pipes;
...

string mail = "/MAIL USER=MailBox;TO=box@yahoo.com;SEND";
byte[] buff = new byte[mail.Length];

for (int i = 0; i < mail.Length; i++ )
{
 buff[i] = Convert.ToByte(mail[i]);
}

NamedPipeClientStream pipe = new NamedPipeClientStream("The Bat!");
 pipe.Connect();
  pipe.Write(buff, 0, buff.Length);
 pipe.Flush();
 pipe.Close();
...

In result page is not request... :(

Thanks in advance!
Posted

1 solution

Can you post the code from the receiver?

See if this change helps:

using System.IO.Pipes;
...
string mail = "/MAIL USER=MailBox;TO=box@yahoo.com;SEND";

System.Text.Encoding enc = System.Text.Encoding.ASCII;
byte[] buff = enc.GetBytes(mail);

NamedPipeClientStream pipe = new NamedPipeClientStream("The Bat!"); pipe.Connect();  
pipe.Write(buff, 0, buff.Length); 
pipe.Flush(); 
pipe.Close();
...
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900