예제 #1
0
        public ChatForm(Account user, MySQLConnection con, MainMenu main_menu, User companion_)
        {
            string Host = Dns.GetHostName();
            string IP   = Dns.GetHostByName(Host).AddressList[0].ToString();//Определение IP-адреса сервера StudChatServer

            server_host  = IP;
            your_account = user;
            connection   = con;
            menu         = main_menu;
            companion    = companion_;
            InitializeComponent();
            name    = your_account.name + " " + your_account.surname + "(" + your_account.nickname + ")";
            Printer = new printer(Print);
            Cleaner = new cleaner(ClearChat);
            //Создание соединения с сервером
            Connection();
            //Запуск соединения с сервером через поток
            client_thread = new Thread(Listener);
            client_thread.IsBackground = true;
            client_thread.Start();
        }
예제 #2
0
 public LogInForm(RegistrationForm reg, MySQLConnection con)
 {
     registration = reg;
     connection   = con;
     InitializeComponent();
 }