C# - Login system doesen't work -


i'm not means @ developing in c#, , i've installed vs15 , i've tried little more advanced me password required enter actual core program. here's code:

using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks;  namespace consoleapplication1 {     class program     {         static void main(string[] args)         {             console.writeline("enter password:");             string input = console.readline;             if input = rekt();                 console.writeline("you entered correct password!");             else                 console.writeline("you entered incorrect password!");          }     } } 

can me fix it? trouble @ "if" part, tbh don't know how end line itself. can please guide me newbie? did not mean make angry or annoyed, please. answers. know guys busy.

assuming rekt() method returns string containing correct password, correct code be:

console.writeline("enter password:"); string input = console.readline(); if (input == rekt())     console.writeline("you entered correct password!"); else     console.writeline("you entered incorrect password!"); console.readkey(); 

you don't need end line of correct password special character, readline() returns actual line, without 'end line' character.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -