Comments are available to members only. Sign up or Log in to view these comments.
Main Topics
Browse All TopicsThese are my code:
Sub AttemptLogin(ByVal val As String)
Dim MDBConn As OleDbConnection
Dim MDBcmd As OleDbCommand
Dim MDBReader As OleDbDataReader
Dim ip_check As Integer
Dim IP_Address As String
Dim frmConUser As New frmConnectUser
frmConUser.StartPosition = FormStartPosition.CenterPa
If val = "REFUSE" Then
frmConUser.lblAlert.Text = "**The user account is logged on**"
client.GetStream.Dispose()
client.Close()
ElseIf val = "WRONG" Then
frmConUser.lblAlert.Text = "**The user account is not exsit or the password is not match!**"
client.GetStream.Dispose()
client.Close()
End If
frmConUser.ShowDialog()
If frmConUser.txtUserLogin.Te
MDBConn = New OleDbConnection("Provider=
MDBConn.Open()
MDBcmd = New OleDbCommand("select * from serverlist order by id", MDBConn)
MDBReader = MDBcmd.ExecuteReader
While MDBReader.Read() And ip_check <> 1
Try
IP_Address = CStr(MDBReader(1))
client = New TcpClient(IP_Address, PORT_NUM)
client.GetStream.BeginRead
ip_check = 1
MDBReader.Close()
MDBConn.Close()
SendData("CONNECT|" & frmConUser.txtUserLogin.Te
'frmConnectUser.Dispose()
'frmConnectUser.Close()
mnuConnect.Text = "Disconnect"
Exit While
Catch ex As Exception
ip_check = 2
End Try
End While
If ip_check = 2 Then
MsgBox("Server is not active. Please start server and try again.", MsgBoxStyle.Exclamation, Me.Text)
Exit Sub
End If
ElseIf mnuConnect.Text = "Disconnect" Then
SendData("DISCONNECT")
MarkAsDisconnected()
client.Close()
mnuConnect.Text = "Connect"
End If
End Sub
I have got error msg for "frmConUser.ShowDialog()" when I run twice times:
System.InvalidOperationExc
Message="復åÃ
Source="mscorlib"
StackTrace:
於 System.Threading.Synchroni
於 System.Threading.Execution
於 System.Threading.Execution
於 System.Runtime.CompilerSer
於 System.Runtime.CompilerSer
於 System.Threading.Execution
於 System.Threading.Execution
於 System.Net.ContextAwareRes
於 System.Net.LazyAsyncResult
於 System.Net.Sockets.BaseOve
於 System.Threading._IOComple
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: wizrrPosted on 2007-11-21 at 04:19:37ID: 20326990
Comments are available to members only. Sign up or Log in to view these comments.