コード例 #1
0
        // "ipc://RfidChannel/RfidServer"
        // 通道打开成功后,窗口应该显示成一种特定的状态
        int StartChannel(
            string strUrl,
            out string strError)
        {
            strError = "";

            //Register the channel with ChannelServices.
            ChannelServices.RegisterChannel(m_rfidChannel, false);

            try
            {
                m_rfidObj = (IRfid)Activator.GetObject(typeof(IRfid),
                                                       strUrl);
                if (m_rfidObj == null)
                {
                    strError = "could not locate Rfid Server";
                    return(-1);
                }
            }
            finally
            {
            }

            return(0);
        }
コード例 #2
0
 void EndChannel()
 {
     if (this.m_rfidObj != null)
     {
         ChannelServices.UnregisterChannel(m_rfidChannel);
         this.m_rfidObj = null;
     }
 }