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. Password Check (Capital and Small)

Password Check (Capital and Small)

Scheduled Pinned Locked Moved ASP.NET
databasequestion
15 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 nour123

    Hi all I have a login form(user name and password) that reads its data from a database, I need to check the password textbox letters case, e.g. if the user wrote "admin" it will be different than "ADMIN"... Is there is any function to do that? Regards...

    Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

    J Offline
    J Offline
    John Sundar
    wrote on last edited by
    #3

    Thanks Abhijit. The same which i would like to post as my next question........ good nour123... me too need a solution for this... HELP US :) . - KARAN. can i get a simple example?

    A 1 Reply Last reply
    0
    • J John Sundar

      Thanks Abhijit. The same which i would like to post as my next question........ good nour123... me too need a solution for this... HELP US :) . - KARAN. can i get a simple example?

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #4

      Hi, I have written a Custom function for that. let me know if it work for you

      public bool IsInputMatch(string UserInput, string DataBaseInput) { if(Regex.IsMatch(UserInput,DataBaseInput)) return true; else return false; }

      now if you use

        if(IsInputMatch("AdMiN", "ADMIN"))
                      MessageBox.Show("Valid User");
                  else
                      MessageBox.Show("InValid User");
      

      Output : InValid User and for this

        if(IsInputMatch("ADMIN", "ADMIN"))
                      MessageBox.Show("Valid User");
                  else
                      MessageBox.Show("InValid User");
      

      Output : Valid User ---- Let me know when done !!! Good luck !!!!:rose:

      Best Regards ----------------- Abhijit Jana Microsoft Certified Professional "Success is Journey it's not a destination"

      J N 2 Replies Last reply
      0
      • A Abhijit Jana

        use Regx ! :)

        Best Regards ----------------- Abhijit Jana Microsoft Certified Professional "Success is Journey it's not a destination"

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

        How to do that sir... Regards

        Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

        A 1 Reply Last reply
        0
        • N nour123

          How to do that sir... Regards

          Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

          A Offline
          A Offline
          Abhijit Jana
          wrote on last edited by
          #6

          Hi, I have written a Custom function for that. let me know if it work for you public bool IsInputMatch(string UserInput, string DataBaseInput) { if(Regex.IsMatch(UserInput,DataBaseInput)) return true; else return false; } now if you use if(IsInputMatch("AdMiN", "ADMIN")) MessageBox.Show("Valid User"); else MessageBox.Show("InValid User"); Output : InValid User and for this if(IsInputMatch("ADMIN", "ADMIN")) MessageBox.Show("Valid User"); else MessageBox.Show("InValid User"); Output : Valid User ---- Let me know when done !!! Good luck !!!!:rose:

          Best Regards ----------------- Abhijit Jana Microsoft Certified Professional "Success is Journey it's not a destination"

          G 1 Reply Last reply
          0
          • A Abhijit Jana

            Hi, I have written a Custom function for that. let me know if it work for you

            public bool IsInputMatch(string UserInput, string DataBaseInput) { if(Regex.IsMatch(UserInput,DataBaseInput)) return true; else return false; }

            now if you use

              if(IsInputMatch("AdMiN", "ADMIN"))
                            MessageBox.Show("Valid User");
                        else
                            MessageBox.Show("InValid User");
            

            Output : InValid User and for this

              if(IsInputMatch("ADMIN", "ADMIN"))
                            MessageBox.Show("Valid User");
                        else
                            MessageBox.Show("InValid User");
            

            Output : Valid User ---- Let me know when done !!! Good luck !!!!:rose:

            Best Regards ----------------- Abhijit Jana Microsoft Certified Professional "Success is Journey it's not a destination"

            J Offline
            J Offline
            John Sundar
            wrote on last edited by
            #7

            THANKS YAAR! :-O

            A 1 Reply Last reply
            0
            • J John Sundar

              THANKS YAAR! :-O

              A Offline
              A Offline
              Abhijit Jana
              wrote on last edited by
              #8

              you are welcome !!!!

              Best Regards ----------------- Abhijit Jana Microsoft Certified Professional "Success is Journey it's not a destination"

              1 Reply Last reply
              0
              • A Abhijit Jana

                Hi, I have written a Custom function for that. let me know if it work for you

                public bool IsInputMatch(string UserInput, string DataBaseInput) { if(Regex.IsMatch(UserInput,DataBaseInput)) return true; else return false; }

                now if you use

                  if(IsInputMatch("AdMiN", "ADMIN"))
                                MessageBox.Show("Valid User");
                            else
                                MessageBox.Show("InValid User");
                

                Output : InValid User and for this

                  if(IsInputMatch("ADMIN", "ADMIN"))
                                MessageBox.Show("Valid User");
                            else
                                MessageBox.Show("InValid User");
                

                Output : Valid User ---- Let me know when done !!! Good luck !!!!:rose:

                Best Regards ----------------- Abhijit Jana Microsoft Certified Professional "Success is Journey it's not a destination"

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

                Thanks alot... It works Love you

                Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

                A 1 Reply Last reply
                0
                • N nour123

                  Thanks alot... It works Love you

                  Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

                  A Offline
                  A Offline
                  Abhijit Jana
                  wrote on last edited by
                  #10

                  welcome !!! if you like the ans then you should vote for them !!!

                  Best Regards ----------------- Abhijit Jana Microsoft Certified Professional "Success is Journey it's not a destination"

                  J 1 Reply Last reply
                  0
                  • A Abhijit Jana

                    welcome !!! if you like the ans then you should vote for them !!!

                    Best Regards ----------------- Abhijit Jana Microsoft Certified Professional "Success is Journey it's not a destination"

                    J Offline
                    J Offline
                    John Sundar
                    wrote on last edited by
                    #11

                    Thanks yaar. And let me know how to disable the "COPY" option while user select the password and right click on it?

                    A 2 Replies Last reply
                    0
                    • J John Sundar

                      Thanks yaar. And let me know how to disable the "COPY" option while user select the password and right click on it?

                      A Offline
                      A Offline
                      Abhijit Jana
                      wrote on last edited by
                      #12

                      John Sundar wrote:

                      And let me know how to disable the "COPY" option while user select the password and right click on it

                      it is very ease in windows just set Textbox1.ShortcutsEnabled=false and use own ContextmenuStrip. but i am not sure about asp.net . i have to check !!!

                      Best Regards ----------------- Abhijit Jana Microsoft Certified Professional "Success is Journey it's not a destination"

                      1 Reply Last reply
                      0
                      • J John Sundar

                        Thanks yaar. And let me know how to disable the "COPY" option while user select the password and right click on it?

                        A Offline
                        A Offline
                        Abhijit Jana
                        wrote on last edited by
                        #13

                        hi jonh , if you use html passwordtext box , it should not allow copy !!!

                        Best Regards ----------------- Abhijit Jana Microsoft Certified Professional "Success is Journey it's not a destination"

                        J 1 Reply Last reply
                        0
                        • A Abhijit Jana

                          hi jonh , if you use html passwordtext box , it should not allow copy !!!

                          Best Regards ----------------- Abhijit Jana Microsoft Certified Professional "Success is Journey it's not a destination"

                          J Offline
                          J Offline
                          John Sundar
                          wrote on last edited by
                          #14

                          S..thanks.. i implemented it.... below there are two questions posted by me... if possible, help me plz. thanks in advance..........

                          1 Reply Last reply
                          0
                          • A Abhijit Jana

                            Hi, I have written a Custom function for that. let me know if it work for you public bool IsInputMatch(string UserInput, string DataBaseInput) { if(Regex.IsMatch(UserInput,DataBaseInput)) return true; else return false; } now if you use if(IsInputMatch("AdMiN", "ADMIN")) MessageBox.Show("Valid User"); else MessageBox.Show("InValid User"); Output : InValid User and for this if(IsInputMatch("ADMIN", "ADMIN")) MessageBox.Show("Valid User"); else MessageBox.Show("InValid User"); Output : Valid User ---- Let me know when done !!! Good luck !!!!:rose:

                            Best Regards ----------------- Abhijit Jana Microsoft Certified Professional "Success is Journey it's not a destination"

                            G Offline
                            G Offline
                            Guffa
                            wrote on last edited by
                            #15

                            Very convenient. :^) You can make a password that matches many different strings... These all show "true": MessageBox.Show(IsInputMatch("Anything that you like", ".*")); MessageBox.Show(IsInputMatch("I mean anything", ".*")); MessageBox.Show(IsInputMatch("Really whatever you want", ".*")); MessageBox.Show(IsInputMatch("", "(hello)?")); MessageBox.Show(IsInputMatch("hello", "(hello)?")); MessageBox.Show(IsInputMatch("asdf", "....")); MessageBox.Show(IsInputMatch("1234", "....")); MessageBox.Show(IsInputMatch("baad", "....")); MessageBox.Show(IsInputMatch("oops", "....")); MessageBox.Show(IsInputMatch("1234", "\\d+")); MessageBox.Show(IsInputMatch("0", "\\d+")); MessageBox.Show(IsInputMatch("987489792364587634582345983745", "\\d+"));

                            Despite everything, the person most likely to be fooling you next is yourself.

                            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