Note that there are some explanatory texts on larger screens.

plurals
  1. POUserName and UserPassword Verification function
    primarykey
    data
    text
    <p>i'm afraid to use User forms data to query the database for user login, since the company has only 20 employees, I'm thinking of this function but I'm no sure if this still a easy code to crack for any no so good hacker user</p> <pre><code>Private Function VerifyCredentials(ByVal User As String, ByVal Password As String) As Boolean Dim verification As Boolean = False Dim _conString As String = WebConfigurationManager.ConnectionStrings ("YounnectionString").ConnectionString 'Initialize connections variables Dim cnn As New SqlConnection(_conString) Dim cmd As New SqlCommand cmd.Connection = cnn cnn.Open() 'No data from the form are used on the SQL Server cmd.CommandText = "Select UserName, UserPassword from tblUsers;" Dim cmdReader As SqlDataReader = cmd.ExecuteReader() 'compare the data from the server with the data from the form, it so not matter what the user send from the form While cmdReader.Read() If Trim(User) = Trim(cmdReader("UserName")) AndAlso Trim(Password) = Trim(cmdReader("UserPassword")) Then verification = True End If End While ' this method may result on performance problems if your tblUsers is too big, 'afther all it is the entrance and most of the companies 'just has several hundred users cmdReader.Close() cmd.CommandText = "" cnn.Close() Return verification End Function </code></pre> <p>Please some one check this code and give me better solution, this company was hack ones and the developer was fired. I'm dont know about security but they want a solution while hire a expert. thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload