Ejemplo n.º 1
0
        private void JoinToChatRoom()
        {
            if (chan == null && username.Trim().Length != 0)
            {
                chan = new TcpChannel();
                ChannelServices.RegisterChannel(chan, false);



                remoteObj = (SampleObject)Activator.GetObject(typeof(RemoteBase.SampleObject), "tcp://localhost:8080/ProjektiPSH");

                if (!remoteObj.JoinToChatRoom(username))
                {
                    MessageBox.Show(username + " ekziston ne linje!");
                    ChannelServices.UnregisterChannel(chan);
                    chan = null;
                    this.Dispose();
                    return;
                }
                key = remoteObj.CurrentKeyNo();

                yourName = username;
            }
        }