0
모바일 ASP.Net 웹 응용 프로그램에 Two Factor Authentication을 추가했습니다. 사용자가 사용자 이름과 암호를 성공적으로 입력하면 핀 번호가 데이터베이스에 저장된 전자 메일 주소로 전자 메일로 전송됩니다. 내가 겪고있는 문제는 사용자에게 전자 메일이 정의되지 않았다는 것을 알리고 로그인 페이지를 다시로드했지만 사용자 코드에 로그인하지 않고 Login.aspx 페이지를 다시로드한다는 것입니다.메시지를 사용자에게 표시 한 다음 포기하십시오.
Private Sub GeneratePin()
Dim r As New Random(System.DateTime.Now.Millisecond)
_Pin = CStr(r.Next(1000, 99999))
_email = CIAppGlobals.CurrentUser.UsrContactEmail
With lblPin
.Text = "PIN has been emailed to the you please check your email now."
End With
If Not String.IsNullOrEmpty(_email) Then
Dim Message As String = " Your Mobile PIN number is " & _Pin & vbNewLine & "From IP Address: " & CIAppGlobals.AppSettings.ClientIP
Tools.SendEmail(CIAppGlobals.CurrentUser.UsrContactEmail, "Mobile App - Two Factor Authentication", Message)
Else
Dim sText As String = "Please contact the Administrator You do not have an email address defined within Application."
'DirectCast(HttpContext.Current.Handler, System.Web.UI.Page).ClientScript.RegisterStartupScript(Me.[GetType](), "test", "alert('" & sText & "')", True)
Response.Write("<script>alert('" & sText & "');</script>")
Thread.Sleep(5000)
'Session.Abandon()
'FormsAuthentication.SignOut()
Response.Redirect(ParentFolder & "/Login.aspx")
End If
End Sub
흠, 좋은 생각입니다. 고마워요! –