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. General Programming
  3. C#
  4. if (T1.Text = "admin" && T2.Text = "admin")

if (T1.Text = "admin" && T2.Text = "admin")

Scheduled Pinned Locked Moved C#
help
5 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.
  • M Offline
    M Offline
    MS Lee
    wrote on last edited by
    #1

    if (T1.Text = "admin" && T2.Text = "admin") { Console.WriteLine("Login success"); } wasts wrong in this code.. am getting error

    self confidence+hard work=SUCCESS

    B T M C 4 Replies Last reply
    0
    • M MS Lee

      if (T1.Text = "admin" && T2.Text = "admin") { Console.WriteLine("Login success"); } wasts wrong in this code.. am getting error

      self confidence+hard work=SUCCESS

      B Offline
      B Offline
      Brij
      wrote on last edited by
      #2

      use if (T1.Text == "admin" && T2.Text == "admin")

      Cheers!! Brij

      1 Reply Last reply
      0
      • M MS Lee

        if (T1.Text = "admin" && T2.Text = "admin") { Console.WriteLine("Login success"); } wasts wrong in this code.. am getting error

        self confidence+hard work=SUCCESS

        T Offline
        T Offline
        Thomas Weller 0
        wrote on last edited by
        #3

        This is the most frequent programming error of all times: You used the assignment operator (=) instead of the comparison operator (==) in your if statement. Use if (T1.Text == "admin" && T2.Text == "admin") instead, and everything is fine... :) Regards Thomas

        www.thomas-weller.de Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
        Programmer - an organism that turns coffee into software.

        1 Reply Last reply
        0
        • M MS Lee

          if (T1.Text = "admin" && T2.Text = "admin") { Console.WriteLine("Login success"); } wasts wrong in this code.. am getting error

          self confidence+hard work=SUCCESS

          M Offline
          M Offline
          MS Lee
          wrote on last edited by
          #4

          Thanks Briji and thomas,

          self confidence+hard work=SUCCESS

          1 Reply Last reply
          0
          • M MS Lee

            if (T1.Text = "admin" && T2.Text = "admin") { Console.WriteLine("Login success"); } wasts wrong in this code.. am getting error

            self confidence+hard work=SUCCESS

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            Your controls are poorly named, your username and password are hard coded and are the same ? Oh, and you used = instead of ==.

            Christian Graus Driven to the arms of OSX by Vista.

            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