Пример #1
0
        int StartChannel(out string strError)
        {
            strError = "";

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

            try
            {
                m_idcardObj = (IIdcard)Activator.GetObject(typeof(IIdcard),
                    this.textBox_idcardReader_serverUrl.Text);
                if (m_idcardObj == null)
                {
                    strError = "could not locate Idcard Server";
                    return -1;
                }
            }
            finally
            {
            }

            return 0;
        }
Пример #2
0
        int StartIdcardChannel(
            string strUrl,
            out string strError)
        {
            strError = "";

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

            try
            {
                m_idcardObj = (IIdcard)Activator.GetObject(typeof(IIdcard),
                    strUrl);
                if (m_idcardObj == null)
                {
                    strError = "无法连接到服务器 " + strUrl;
                    return -1;
                }
            }
            finally
            {
            }

            return 0;
        }