예제 #1
0
        // This opens a new window to ask user for a username
        private void setUserName()
        {
            // Opening the userNamePrompt window
            UserNamePrompt userNamePrompt = new UserNamePrompt();

            userNamePrompt.ShowDialog();
        }
예제 #2
0
        // Delete the username and make a new one
        private void DeleteUserName(object sender, MouseButtonEventArgs e)
        {
            // We close the main window
            DBChat mainwindow = new DBChat();

            mainwindow.Close();
            // We grab the file with user name in it and delete the file
            string path = "UserNameFile.txt";

            File.Delete(path);
            // We start the userNamePrompt and get the user to input a username
            UserNamePrompt userNamePrompt = new UserNamePrompt();

            userNamePrompt.ShowDialog();
        }