Ejemplo n.º 1
0
        private void fileSystemWatcher2_Changed(object sender, FileSystemEventArgs e)
        {
            string request = File.ReadAllText("\\\\" + Class.ip + "\\chat\\talk.txt");

            if (request != "")
            {
                Class.b++;
                if (Class.b == 1)
                {
                    AdminChat Admin = new AdminChat();
                    Admin.Show();
                }
            }
            else
            {
                Class.b = 0;
            }
        }
Ejemplo n.º 2
0
        private void lblAdmin_MouseClick(object sender, MouseEventArgs e)
        {
            string ip = File.ReadAllText("\\\\" + Class.ip + "\\chat\\talk.txt");

            if (ip == "")
            {
                talk = true;
                File.WriteAllText("\\\\" + Class.ip + "\\chat\\talk.txt", Dns.GetHostName() + "\r\n");
                if (Class.adamin == false)
                {
                    AdminChat admin = new AdminChat();
                    admin.ShowDialog();
                }
            }
            else
            {
                MessageBox.Show("Another client is talking to admin please wait!");
            }
        }