示例#1
0
        // Disconect the user
        private void LogoutButton_Click(object sender, EventArgs e)
        {
            UserData      user      = new UserData();
            SuperUserData superUser = new SuperUserData();

            if (File.Exists("userData.xml"))
            {
                user = XmlDataManager.XmlUserDataReader("userData.xml");
                if (user.UserAttribut != "SuperAdmin")
                {
                    Disconnect_USer(User_online);
                    //Application.ExitThread();
                    Application.Exit();
                }
                else
                {
                    if (File.Exists("SuperUserStatut.xml"))
                    {
                        superUser = XmlDataManager.XmlSuperUserDataReader("SuperUserStatut.xml");

                        superUser.SuperUserstatut = 0;
                        XmlDataManager.XmlDataWriter(superUser, "SuperUserStatut.xml");
                        Application.Exit();
                    }
                }
            }
        }