示例#1
0
        public void CreateUser()
        {
            string rep = AskQuestion(definitions.FormTitle.AddUser, definitions.Question.AddUser);

            if (rep != "")
            {
                bool          bFirst = false;
                File.textlist f      = ObtaintUserTextList();
                if (f.IsExist(rep))
                {
                    MessageBox.Show(definitions.Message.UserExist);
                    return;
                }
                if (!LoadCurrentUser())
                {
                    bFirst = true;
                }
                f.Items.Add(rep);
                f.Sort();
                f.WriteList();
                Object.User u = new User(rep);
                u.CreateUser();

                if (bFirst)
                {
                    SetCurrentUser(rep, true);
                }
                UpdateAllUserScript();
            }
        }
示例#2
0
文件: listbox.cs 项目: dgx80/peon
 public void SaveFile()
 {
     mFile.WriteList();
     MessageBox.Show("The file is saved");
 }