Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How password be case sensitive?

How password be case sensitive?

Scheduled Pinned Locked Moved ASP.NET
questiondatabase
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nour123
    wrote on last edited by
    #1

    Dear all.. I have a login form, when I click the submit button, the code checks the users name and the password in the database if it is available, but it checks the password without its case(e.g.: the string "nour" is similar to the string "NOUR") How can I control the password to be case sensitive? Regards.. Nour Abdel-Salam

    M K P 3 Replies Last reply
    0
    • N nour123

      Dear all.. I have a login form, when I click the submit button, the code checks the users name and the password in the database if it is available, but it checks the password without its case(e.g.: the string "nour" is similar to the string "NOUR") How can I control the password to be case sensitive? Regards.. Nour Abdel-Salam

      M Offline
      M Offline
      M A A Mehedi Hasan
      wrote on last edited by
      #2

      Hi, One solution may be retriving the password from the db and check the password in the code level.

      Mehedi Hasan

      1 Reply Last reply
      0
      • N nour123

        Dear all.. I have a login form, when I click the submit button, the code checks the users name and the password in the database if it is available, but it checks the password without its case(e.g.: the string "nour" is similar to the string "NOUR") How can I control the password to be case sensitive? Regards.. Nour Abdel-Salam

        K Offline
        K Offline
        kiran kumar Intelligroup
        wrote on last edited by
        #3

        Hi, int result = string.Compare(txtPwd.Text,strdbPwd,false); Here false means accept case sensitive true means ignore case sensitive

        Kiran Kumar.CH (MCP)

        N 1 Reply Last reply
        0
        • N nour123

          Dear all.. I have a login form, when I click the submit button, the code checks the users name and the password in the database if it is available, but it checks the password without its case(e.g.: the string "nour" is similar to the string "NOUR") How can I control the password to be case sensitive? Regards.. Nour Abdel-Salam

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          If you are using Sql Server, you could always cast the passwords to Varbinary and compare them.

          SELECT ...
          FROM UserList
          WHERE UserName = @UserName AND
          CAST(Password AS VARBINARY(30)) = CAST(@Password AS VARBINARY(30))

          the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
          Deja View - the feeling that you've seen this post before.

          N 1 Reply Last reply
          0
          • P Pete OHanlon

            If you are using Sql Server, you could always cast the passwords to Varbinary and compare them.

            SELECT ...
            FROM UserList
            WHERE UserName = @UserName AND
            CAST(Password AS VARBINARY(30)) = CAST(@Password AS VARBINARY(30))

            the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
            Deja View - the feeling that you've seen this post before.

            N Offline
            N Offline
            nour123
            wrote on last edited by
            #5

            Thanx alot... It works..Baby Have a nice day

            1 Reply Last reply
            0
            • K kiran kumar Intelligroup

              Hi, int result = string.Compare(txtPwd.Text,strdbPwd,false); Here false means accept case sensitive true means ignore case sensitive

              Kiran Kumar.CH (MCP)

              N Offline
              N Offline
              nour123
              wrote on last edited by
              #6

              Thanx alot baby it works (.) (.) Have a sexy day..

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups