Example #1
0
 static void PipeListener()
 {
     try
     {
         NamedPipeClientStream pipeClient = new NamedPipeClientStream(".", "NowPlayingTunes", PipeDirection.InOut, PipeOptions.None);
         StreamString          ss         = new StreamString(pipeClient);
         pipeClient.Connect();
         String rettext = ss.ReadString();
         Console.WriteLine(rettext);
         pipeClient.Close();
         pipeClient.Dispose();
     }
     catch (Exception ex)
     {
     }
     if (DebugMode == false)
     {
         if (TimeoutThread.IsAlive == true)
         {
             TimeoutThread.Abort();
         }
     }
 }
Example #2
0
        static void PipeListener()
        {
            try
            {
                NamedPipeClientStream pipeClient = new NamedPipeClientStream(".", "NowPlayingTunes", PipeDirection.InOut, PipeOptions.None);
                StreamString ss = new StreamString(pipeClient);
                pipeClient.Connect();
                String rettext = ss.ReadString();
                Console.WriteLine(rettext);
                pipeClient.Close();
                pipeClient.Dispose();
            }
            catch (Exception ex)
            {

            }
            if (DebugMode == false)
            {
                if (TimeoutThread.IsAlive == true)
                {
                    TimeoutThread.Abort();
                }
            }
        }