private void button1_Click(object sender, EventArgs e) { if (usernameTextBox.Text != "" && PasswordTextBox.Text != "") { if (clientProxy.login(usernameTextBox.Text, PasswordTextBox.Text)) { var topicman = new TopicManForm(usernameTextBox.Text); topicman.Show(); } else { MessageBox.Show("Compte innexistant"); } } }
static void Main(string[] args) { ChannelFactory <AuthentificationManager> dupFactory = null; AuthentificationManager clientProxy = null; TextChatter _chatter = new TextChatter(); dupFactory = new ChannelFactory <AuthentificationManager>( new NetTcpBinding(), new EndpointAddress("net.tcp://localhost:8999/AuthManager")); dupFactory.Open(); clientProxy = dupFactory.CreateChannel(); int menu = 0; string username; while (menu == 0) { Console.WriteLine("Entrez votre username:"******" Entrez votre password:"******"1.Se connecter \n 2.s'inscrire"); switch (Console.ReadLine()) { case "1": if (clientProxy.login(username, password)) { joinTopicsManager(username); } break; case "2": clientProxy.addUser(username, password); break; } } }