listener = New TcpListener(System.Net.IPAddress.Any, portconnect)
listener.Start()
client = listener.AcceptTcpClient
loginInfo = receivedata()
Dim array() As String
array = loginInfo.Split("|")
username = array(0)
pass = array(1)
정보 클라이언트가 logininfo입니다. 내가 사용자 이름과 비밀 번호로 logininfo을 slipt.클라이언트에서 서버 vb.net로 실제 문자열 얻기
Public Function authentication(ByVal user As String, ByVal pass As String) As Boolean
Dim authentica As Boolean = False
Dim con As New OleDbConnection
Try
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & " data source= " & Application.StartupPath & "\" & dataName
Dim myCommand As OleDbCommand = con.CreateCommand()
Dim sqlstr As String = ""
sqlstr = "Select password from tbusers where Username = " & "'" & user & "'"
myCommand.CommandText = sqlstr
con.Open()
Dim passw As String
passw = myCommand.ExecuteScalar()
con.Close()
If pass = passw Then
authentica = True
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Return authentica
End Function
문제는 다음과 같습니다 If pass = passw Then authentica = True End If
이 가에 allways false를 돌려줍니다. 도와주세요
클라이언트가 데이터를 보내면 데이터가 캡슐화됩니다. 디버그, user는 username이고 newstr은 "username"입니다. 부울 사용자 = newstr, 거짓을 반환합니다. –
이미 작동하지 않는 코드를 표시하십시오. –