int StartChannel( string strUrl, out string strError) { strError = ""; Uri uri = new Uri(strUrl); string strScheme = uri.Scheme.ToLower(); if (strScheme == "ipc") { channel = new IpcClientChannel(); } else if (strScheme == "tcp") { channel = new TcpClientChannel(); } else if (strScheme == "http") { channel = new HttpClientChannel(); } else { strError = "URL '" + strUrl + "' 中包含了无法识别的Scheme '" + strScheme + "'。只能使用 ipc tcp http 之一"; return(-1); } //Register the channel with ChannelServices. ChannelServices.RegisterChannel(channel, false); try { this.obj = (ICardCenter)Activator.GetObject(typeof(ICardCenter), strUrl); if (this.obj == null) { strError = "无法连接到 Remoting 服务器 " + strUrl; return(-1); } } finally { } return(0); }
int StartChannel(out string strError) { strError = ""; //Register the channel with ChannelServices. ChannelServices.RegisterChannel(channel, false); try { obj = (DkywInterface)Activator.GetObject(typeof(DkywInterface), "ipc://CardChannel/DkywInterface"); if (obj == null) { strError = "could not locate Card Server"; return(-1); } } finally { } return(0); }
int StartChannel(out string strError) { strError = ""; //Register the channel with ChannelServices. ChannelServices.RegisterChannel(channel, false); try { obj = (DkywInterface)Activator.GetObject(typeof(DkywInterface), "ipc://CardChannel/DkywInterface"); if (obj == null) { strError = "could not locate Card Server"; return -1; } } finally { } return 0; }