Imports System.Text Public Class UserLogin Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents txtSearchID As System.Windows.Forms.TextBox Friend WithEvents btnSearch As System.Windows.Forms.Button Friend WithEvents grdResult As System.Windows.Forms.DataGrid Friend WithEvents btnLogOut As System.Windows.Forms.Button Friend WithEvents lblhanaccount As System.Windows.Forms.Label Friend WithEvents lbltitle As System.Windows.Forms.Label Private Sub InitializeComponent() Me.lbltitle = New System.Windows.Forms.Label() Me.GroupBox1 = New System.Windows.Forms.GroupBox() Me.btnSearch = New System.Windows.Forms.Button() Me.txtSearchID = New System.Windows.Forms.TextBox() Me.grdResult = New System.Windows.Forms.DataGrid() Me.btnLogOut = New System.Windows.Forms.Button() Me.lblhanaccount = New System.Windows.Forms.Label() Me.GroupBox1.SuspendLayout() CType(Me.grdResult, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'lbltitle ' Me.lbltitle.AutoSize = True Me.lbltitle.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lbltitle.Font = New System.Drawing.Font("Gulim", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(129, Byte)) Me.lbltitle.Location = New System.Drawing.Point(440, 48) Me.lbltitle.Name = "lbltitle" Me.lbltitle.Size = New System.Drawing.Size(261, 24) Me.lbltitle.TabIndex = 0 Me.lbltitle.Text = "·Î±×ÀΠüũ / °­Á¦ ·Î±×¾Æ¿ô" ' 'GroupBox1 ' Me.GroupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.lblhanaccount, Me.btnSearch, Me.txtSearchID}) Me.GroupBox1.Location = New System.Drawing.Point(80, 88) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(528, 64) Me.GroupBox1.TabIndex = 1 Me.GroupBox1.TabStop = False ' 'btnSearch ' Me.btnSearch.Location = New System.Drawing.Point(320, 24) Me.btnSearch.Name = "btnSearch" Me.btnSearch.Size = New System.Drawing.Size(88, 24) Me.btnSearch.TabIndex = 1 Me.btnSearch.Text = "°Ë»ö" ' 'txtSearchID ' Me.txtSearchID.Location = New System.Drawing.Point(144, 24) Me.txtSearchID.Name = "txtSearchID" Me.txtSearchID.Size = New System.Drawing.Size(136, 21) Me.txtSearchID.TabIndex = 0 Me.txtSearchID.Text = "" ' 'grdResult ' Me.grdResult.DataMember = "" Me.grdResult.HeaderForeColor = System.Drawing.SystemColors.ControlText Me.grdResult.Location = New System.Drawing.Point(80, 160) Me.grdResult.Name = "grdResult" Me.grdResult.Size = New System.Drawing.Size(848, 216) Me.grdResult.TabIndex = 2 ' 'btnLogOut ' Me.btnLogOut.Location = New System.Drawing.Point(496, 408) Me.btnLogOut.Name = "btnLogOut" Me.btnLogOut.Size = New System.Drawing.Size(128, 32) Me.btnLogOut.TabIndex = 3 Me.btnLogOut.Text = "·Î±×¾Æ¿ô" ' 'lblhanaccount ' Me.lblhanaccount.AutoSize = True Me.lblhanaccount.Location = New System.Drawing.Point(72, 29) Me.lblhanaccount.Name = "lblhanaccount" Me.lblhanaccount.Size = New System.Drawing.Size(66, 14) Me.lblhanaccount.TabIndex = 3 Me.lblhanaccount.Text = "ÇѰÔÀÓ°èÁ¤" ' 'UserLogin ' Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14) Me.ClientSize = New System.Drawing.Size(1028, 693) Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnLogOut, Me.grdResult, Me.GroupBox1, Me.lbltitle}) Me.Name = "UserLogin" Me.Text = "·Î±×ÀΠüũ / °­Á¦ ·Î±×¾Æ¿ô" Me.GroupBox1.ResumeLayout(False) CType(Me.grdResult, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub #End Region Private Sub UserLogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ProcessPacket.IUserLogin = Me txtSearchID.MaxLength = 15 Me.Text = ITextUserLogOut.formheader_curr Me.lbltitle.Text = ITextUserLogOut.formheader_curr btnSearch.Text = ITextButton.btnSearch btnLogOut.Text = ITextButton.btnLogOut ds.Tables(CurrentUserIndex).Clear() grdResult.DataSource = ds.Tables(CurrentUserIndex) If IToolAdminRight.currentUserLogin = False Then btnSearch.Enabled = False Else btnSearch.Enabled = True End If If IToolAdminRight.DoingLogout = False Then btnLogOut.Enabled = False Else btnLogOut.Enabled = True End If End Sub Private Sub UserLogin_Unload(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Closed ProcessPacket.IUserLogin = Nothing ProcessPacket.IRylMDI.IUserLogin = Nothing End Sub '°Ë»öÇϱâ Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click ds.Tables(CurrentUserIndex).Clear() CurrentUserRefresh() End Sub Public Sub CurrentUserRefresh() btnSearch.Enabled = False If txtSearchID.Text = "" Then MsgBox(ITextMSG.msg_inputadminid, MsgBoxStyle.OKOnly, ITextMSG.msg_confirm) txtSearchID.Focus() btnSearch.Enabled = True Exit Sub End If 'ƯÁ¤ °ü¸®ÀÚ ID °Ë»ö ÆÐŶ Dim sendb(15) As Byte Encoding.GetEncoding(Code).GetBytes(txtSearchID.Text, 0, Min(16, txtSearchID.Text.Length), sendb, 0) IClientSocket.Send(7, sendb) btnSearch.Enabled = True End Sub Private Sub btnLogOut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogOut.Click 'ÇöÀç Ŭ¸¯µÈ rowÀÇ À妽º¹øÈ£(0ºÎÅÍ ½ÃÀÛÇÑ´Ù.) 'Dim SelectedCellText As String = grdResult.Item(grdResult.CurrentCell) Dim CurrentIndex As Integer = grdResult.CurrentRowIndex Dim ClientID As String = grdResult.Item(CurrentIndex, 0) Dim UID As Int32 = grdResult.Item(CurrentIndex, 3) Dim ServerID As Int32 = grdResult.Item(CurrentIndex, 5) btnLogOut.Enabled = False Dim DeleteYesNo As Integer = _ MsgBox(ClientID + " " + ITextMSG.msg_logout, MsgBoxStyle.YesNo, ITextMSG.msg_confirm) If DeleteYesNo = vbYes Then Dim sendb(7) As Byte Array.Copy(BitConverter.GetBytes(UID), 0, sendb, 0, 4) Array.Copy(BitConverter.GetBytes(ServerID), 0, sendb, 4, 4) IClientSocket.Send(8, sendb) Else MsgBox(ITextMSG.msg_cancel, MsgBoxStyle.OKOnly, "Cancel") End If btnLogOut.Enabled = True End Sub End Class