Ejemplo n.º 1
0
 public string Command(string command)
 {
     using (ClientPipe pipe = new ClientPipe(PipeName)) {
         if (!pipe.Connect())
             return "ER Cannot connect to pipe server";
         try {
             return pipe.Command(command);
         } catch (NamedPipes.PipeException e) {
             return "ER " + e.Message;
         }
     }
 }
Ejemplo n.º 2
0
 private string Command(string command)
 {
     lock (PipeName)
         using (var pipe = new ClientPipe(PipeName))
         {
             if (!pipe.Connect())
                 return "ER Cannot connect to pipe server";
             try
             {
                 return pipe.Command(command);
             }
             catch (PipeException e)
             {
                 return "ER " + e.Message;
             }
         }
 }