This commit is contained in:
ms
2018-11-23 11:35:25 +01:00
parent a23ee8809f
commit 94a5b5bf98
5 changed files with 59 additions and 10 deletions

View File

@@ -619,4 +619,50 @@ Public Class Class1
con.Close()
End Function
Public Shared Function GetUserPasswort(ip As String, ByRef User As String, ByRef Password As String)
Dim tmp As New AutoCompleteStringCollection()
Dim con As New SqlConnection
Dim cmd As New SqlCommand
Dim reader As SqlDataReader
con.ConnectionString = Class1.DBConString
cmd.Connection = con
con.Open()
cmd.CommandText = "SELECT Benutzer, Passwort FROM TbL_Netzwerkclients WHERE IPAdresse = '" & ip & "' "
reader = cmd.ExecuteReader()
Do While reader.Read
User = ReadNullAsEmptyString(reader, "Benutzer")
Password = ReadNullAsEmptyString(reader, "Passwort")
Loop
con.Close()
End Function
Public Shared Function MainHost(ip As String)
Dim tmp As New AutoCompleteStringCollection()
Dim con As New SqlConnection
Dim cmd As New SqlCommand
Dim reader As SqlDataReader
con.ConnectionString = Class1.DBConString
cmd.Connection = con
Dim LinkedWith As String
con.Open()
cmd.CommandText = "SELECT LinkedWith FROM TbL_Netzwerkclients WHERE IPAdresse = '" & ip & "' "
reader = cmd.ExecuteReader()
Do While reader.Read
LinkedWith = ReadNullAsEmptyString(reader, "LinkedWith")
Loop
con.Close()
If LinkedWith = "" Then
Return ip
Else
Return LinkedWith
End If
End Function
End Class