Public Class LoginForm ' TODO: Á¦°øµÈ »ç¿ëÀÚ À̸§°ú ¾ÏÈ£¸¦ »ç¿ëÇÏ¿© »ç¿ëÀÚ ÁöÁ¤ ÀÎÁõÀ» ¼öÇàÇÏ´Â Äڵ带 »ðÀÔÇÕ´Ï´Ù ' (https://go.microsoft.com/fwlink/?LinkId=35339 ÂüÁ¶). ' ±×·¯¸é »ç¿ëÀÚ ÁöÁ¤ º¸¾È ÁÖü°¡ ÇöÀç ½º·¹µåÀÇ º¸¾È ÁÖü¿¡ ´ÙÀ½°ú °°ÀÌ Ã·ºÎµÉ ¼ö ÀÖ½À´Ï´Ù. ' My.User.CurrentPrincipal = CustomPrincipal ' ¿©±â¼­ CustomPrincipalÀº ÀÎÁõÀ» ¼öÇàÇÏ´Â µ¥ »ç¿ëµÇ´Â IPrincipalÀÌ ±¸ÇöµÈ °ÍÀÔ´Ï´Ù. ' ³ªÁß¿¡ My.User´Â CustomPrincipal °³Ã¼¿¡ ĸ½¶È­µÈ »ç¿ëÀÚ À̸§, Ç¥½Ã À̸§ µîÀÇ ' ID Á¤º¸¸¦ ¹ÝȯÇÕ´Ï´Ù. Public Structure UserData Public UserID As String Public UserPW As String Public IDType As String Public ExtPermition As String Public NowState As Int16 End Structure Public UserInfo As UserData Private Const InfoTypeNumber As String = "10" Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click Try With UserInfo .UserID = String.Empty .UserPW = String.Empty .IDType = String.Empty .ExtPermition = String.Empty End With Dim DBCmd As String = "SELECT UserID,UserPW,IDType,ExtPermition,NowState FROM " & LoginDB & " WHERE UserID = '" & txbUserID.Text & "'" If DBQueryReader(DBCmd) Then UserInfo.UserID = sqlDataQuery(0) UserInfo.UserPW = sqlDataQuery(1) UserInfo.IDType = sqlDataQuery(2) UserInfo.ExtPermition = sqlDataQuery(3) UserInfo.NowState = sqlDataQuery(4) If UserInfo.UserPW = txbUserPW.Text Then If UserInfo.IDType = InfoTypeNumber Then If UserInfo.NowState <> 1 Then If NowStateUpdate() Then MsgBox("·Î±×ÀÎ µµÁß ¿À·ù°¡ ¹ß»ýÇÏ¿´½À´Ï´Ù.", vbCritical) GoTo FailFunc End If MainForm.Show() Me.Hide() Exit Sub Else MsgBox("ÇöÀç Á¢¼ÓÁßÀÎ °èÁ¤ÀÔ´Ï´Ù.", vbExclamation) GoTo FailFunc End If Else GoTo loginFail End If Else GoTo loginFail End If Else GoTo loginFail End If Catch ex As Exception GoTo loginFail End Try loginFail: MsgBox("¾ÆÀ̵ð ¹× ºñ¹Ð¹øÈ£°¡ À߸øµÇ¾ú½À´Ï´Ù.", vbExclamation) FailFunc: txbUserID.Text = String.Empty txbUserPW.Text = String.Empty txbUserID.Focus() End Sub Private Function NowStateUpdate() As Boolean Dim DBCmd As String = "UPDATE " & LoginDB & " SET NowState = '1' WHERE UserID = '" & txbUserID.Text & "'" If DBCommand(DBCmd) Then Return False Else Return True End If End Function Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click Me.Close() End Sub Private Sub LoginForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load End Sub End Class