TcpChannel chan = new TcpChannel();
ChannelServices.RegisterChannel(chan);
Interface.IDALService service = (Interface.IDALService)Activator.GetObject(typeof(Interface.IDALService),"tcp://localhost:9000/GOA Data Access Layer Service");
//Database db = service.GetDatabase();
//string s = (string)db.ExecuteScalar(System.Data.CommandType.Text , "select messageid from t_message");
string s = service.Test();
//ChannelServices.UnregisterChannel(chan);
我的clinet就是没有固定端口
TcpChannel chan = new TcpChannel();
ChannelServices.RegisterChannel(chan);
Interface.IDALService service = (Interface.IDALService)Activator.GetObject(typeof(Interface.IDALService),"tcp://localhost:9000/GOA Data Access Layer Service");
string s = service.Test();