I need to compare a username and password to a dictionary
CODE
'get cookies
Dim co1 As String
Dim co2 As String
co1 = "user"
co2 = "pws"
'create database
Dim users As New Dictionary(Of String, String)
' Add items to the dictionary
users.Add("rikki", "me")
Dim cookie As New System.Web.HttpCookie(co1)
Dim cookies As New System.Web.HttpCookie(co2)
If cookie.Value = Nothing Then
MsgBox("error1")
Exit Sub
ElseIf cookies.Value = Nothing Then
MsgBox("error2")
Exit Sub
End If
co1 = Request.Cookies(co1).Value
co2 = Request.Cookies(co2).Value
Dim key As System.Collections.Generic.KeyValuePair(Of String, String)
For Each key In users
'need to be able to compare co1 and co2 to key
'co1 is username
'co2 is password
Next
I have made the code to get the username and password from a cookie
the database is a dictionary which needs to be searched
username as name
password as value nice and simple system
but then they must be compared to be seen as the same or not