Пример #1
0
 public void StopCPPPlayer2()
 {
     try
     {
         lock (locked)
         {
             if (!CFlag)
             {
                 if (TsCmdStoreID != null)
                 {
                     string strSql = string.Format("update PLAYRECORD set PR_REC_STATUS = '{0}' where PR_SourceID='{1}'", "删除", TsCmdStoreID);
                     strSql += "delete from InfoVlaue";
                     //string strSql = "update PLAYRECORD set PR_REC_STATUS = '删除'";
                     mainForm.dba.UpdateDbBySQL(strSql);
                     Console.WriteLine(strSql + "成功!");
                 }
                 CoreEvent.SetEvent(m_handle);
                 //CoreEvent.CloseHandle(m_handle);
                 pipeStream.Close();
                 CFlag = true;
             }
         }
     }
     catch
     {
         return;
     }
 }
Пример #2
0
 public void StopCPPPlayer()
 {
     try
     {
         pipeStream.WaitForConnection();
         using (StreamReader sr = new StreamReader(pipeStream))
         {
             string line;
             while ((line = sr.ReadLine()) != null)
             {
                 Thread.Sleep(500);
                 string strValue = line;
                 if (line == "-1000")
                 {
                     //CFlag=true;
                     Console.WriteLine(m_handle);
                     break;
                 }
             }
         }
         //CoreEvent.SetEvent(m_handle);
         lock (locked)
         {
             if (!CFlag)
             {
                 if (TsCmdStoreID != null)
                 {
                     string strSql = string.Format("update PLAYRECORD set PR_REC_STATUS = '{0}' where PR_SourceID='{1}'", "删除", TsCmdStoreID);
                     strSql += "delete from InfoVlaue";
                     //string strSql = "update PLAYRECORD set PR_REC_STATUS = '删除'";
                     mainForm.dba.UpdateDbBySQL(strSql);
                     Console.WriteLine(strSql + "成功!");
                 }
                 CoreEvent.SetEvent(m_handle);
                 //CoreEvent.CloseHandle(m_handle);
                 pipeStream.Close();
                 CFlag = true;
             }
         }
         //CoreEvent.CloseHandle(m_handle);
     }
     catch
     {
         return;
     }
 }