public UserSchema Get(ulong id)
        {
            UserSchema userSchema = new UserSchema();

            userSchema.id     = id;
            this.streamReader = new StreamReader(System.Windows.Forms.Application.StartupPath + "\\UserList.txt");
            UserSchema tmp;

            while (!this.streamReader.EndOfStream)
            {
                try
                {
                    tmp = UserSchema.ReadStringLine(this.streamReader.ReadLine(), '^');
                }
                catch (Exception e)
                {
                    this.streamReader.Dispose();
                    return(null);
                }

                if (UserSchema.isSameID(userSchema, tmp))
                {
                    this.streamReader.Dispose();
                    return(tmp);
                }
            }
            this.streamReader.Dispose();
            return(null);
        }
示例#2
0
        private void button3_Click(object sender, EventArgs e)
        {
            switch (this.state)
            {
            case 1:
                if (this.keypadForm.ShowGetDialog() == DialogResult.OK)
                {
                    UserSchema search = UserProcessor.GetProcessor().Get(this.keypadForm.ID_result);
                    if (search != null)
                    {
                        //다음 폼 이동
                    }
                }
                break;

            case 2:
                if (this.keypadForm.ShowSendDialog() == DialogResult.OK)
                {
                    result = UserProcessor.GetProcessor().Get(this.keypadForm.ID_result);
                    if (result == null)
                    {
                        new MessageForm("오류", "없는 사용자 입니다.", "확인", "확인").ShowDialog();
                    }
                    this.animationWindow.DoCloseAnimation();
                }
                break;
            }
        }
 public static bool isSameID(UserSchema userSchema, UserSchema userSchema2)
 {
     return(userSchema.id == userSchema2.id);
 }
 public static bool isSameKey(UserSchema userSchema, UserSchema userSchema2)
 {
     return(userSchema.key == userSchema2.key);
 }