public ActionResult JoinCompleteProc(string Token)
        {
            if (!String.IsNullOrEmpty(Token))
            {
                string HashToken = AES256.Decrypt(Token, this.Secret, true);
                if (!String.IsNullOrEmpty(HashToken))
                {
                    MailAuth auth = new MailAuth();
                    Member member = new Member();

                    using (var context = new SharedPlayerContext())
                    {
                        auth = context.MailAuths.Where(x => x.Token.Equals(HashToken)).Where(x => x.IsComplete == false).FirstOrDefault();

                        if (auth != null && auth.AuthID > 0)
                        {
                            member = context.Members.Where(x => x.MemberID == auth.MemberID).FirstOrDefault();
                            auth.IsComplete = true;
                            auth.AcceptDate = DateTime.Now;
                            member.IsMailAuth = true;
                            member.LastUpdate = DateTime.Now;
                            context.SaveChanges();
                            return View(this);
                        }
                        else
                        {
                            return RedirectToAction("ErrorGuide", "Home", new { ErrCode = 4901 });
                        }
                    }
                }
                else
                {
                    return RedirectToAction("ErrorGuide", "Home", new { ErrCode = 4902 });
                }
            }
            else
            {
                return RedirectToAction("ErrorGuide", "Home", new { ErrCode = 4903 });
            }
        }
        public JsonResult JoinProc(Member member)
        {
            try
            {
                bool chk = false;
                string msg = String.Empty;

                member.RegDate = DateTime.Now;
                member.LastUpdate = DateTime.Now;
                member.IsMailAuth = false;
                member.Password = Sha512.CreateHash(member.Password);
                using (var context = new SharedPlayerContext())
                {
                    var checkList = context.Members.Where(x => x.Email.Equals(member.Email)).Count();
                    if (checkList > 0)
                    {
                        chk = false;
                        msg = "이미 사용중인 이메일 입니다.";
                    }
                    else
                    {
                        context.Members.Add(member);
                        context.SaveChanges();
                        if (member.MemberID > 0)
                        {
                            MailAuth auth = new MailAuth();
                            auth.AcceptDate = DateTime.Now;
                            auth.Email = member.Email;
                            auth.IsComplete = false;
                            auth.member = member;
                            auth.RegDate = DateTime.Now;
                            auth.Token = Salt.RandomString(16);
                            context.MailAuths.Add(auth);
                            context.SaveChanges();
                            if (auth.AuthID > 0)
                            {
                                string URL = String.Format("{0}://{1}/Member/JoinCompleteProc?Token={2}", Request.Url.Scheme, Request.Url.Host, AES256.Encrypt(auth.Token, this.Secret, true));
                                StringBuilder builder = new StringBuilder();
                                builder.Append(FileHandler.ReadFile(Server.MapPath("~/Content/MemberJoin.html"), Encoding.UTF8));
                                builder.Replace("{URL}", URL);
                                if (Mail.Send(member.Email, "[SharedPlayer.net] 회원가입 인증메일입니다.", builder.ToString()))
                                {
                                    chk = true;
                                }
                                else
                                {
                                    chk = false;
                                    msg = "인증메일 발송이 실패하였습니다. 잠시 후 다시 시도해 주세요.";
                                }
                            }
                            else
                            {
                                chk = false;
                                msg = "인증메일 발송이 실패하였습니다. 잠시 후 다시 시도해 주세요.";
                            }
                        }
                    }
                }

                return Json(new
                {
                    Check = chk,
                    Message = msg
                });
            }
            catch (Exception ex)
            {
                if (ex.InnerException != null)
                {
                    return Json(new
                    {
                        Check = false,
                        Message = ex.InnerException.InnerException.Message
                    });
                }
                else
                {
                    return Json(new
                    {
                        Check = false,
                        Message = "2. " + ex.Message
                    });
                }
            }
        }