Lexity Posted July 22, 2017 Posted July 22, 2017 So basically when I put nothing in the username and pass box It works, but when I put wrong shit, It fails. Does any one know how to fix this login problem for my program? Login Source Code: string test = materialSingleLineTextField1.Text + ":" + materialSingleLineTextField2.Text; if (new WebClient().DownloadString("--CENSORED--").Contains(test)) { MessageBox.Show("Success"); new Form2().Show(); base.Hide(); } else { MessageBox.Show("Failed"); base.Close();
atom0s Posted July 22, 2017 Posted July 22, 2017 Check if the text boxes are empty, if so do not allow it to try and login.
Lexity Posted July 22, 2017 Author Posted July 22, 2017 53 minutes ago, atom0s said: Check if the text boxes are empty, if so do not allow it to try and login. idk man i tried that but it keeps giving me error so i kind of quit and tried asking forum people.
atom0s Posted July 23, 2017 Posted July 23, 2017 What you are asking is fairly basic level coding for this kind of thing. If you are having issues with that, it sounds like you are not really ready for what you are actually working on. You can check string lengths via . Length property of a string. Which in your case 'materialSingleLineTextField1.Text' would have the .Length property you can use. You can also use 'string.IsNullOrEmpty' to check if either text boxes string is empty.
Lexity Posted July 23, 2017 Author Posted July 23, 2017 13 minutes ago, atom0s said: What you are asking is fairly basic level coding for this kind of thing. If you are having issues with that, it sounds like you are not really ready for what you are actually working on. You can check string lengths via . Length property of a string. Which in your case 'materialSingleLineTextField1.Text' would have the .Length property you can use. You can also use 'string.IsNullOrEmpty' to check if either text boxes string is empty. thenx but i fixed problemmmmmmmmmm im try8ing to make hwid thing now ok thank you
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now