My First day with C#

Grammar_Jew

New member
Joined
Sep 12, 2015
Messages
1
Programming Experience
1-3
Today was my first day with C#. I have been coding with C++ for 3 months though :p.

Here is my showcase lol...

C#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Learn
{
    class Program
    { 
        static void Main(string[] args)
        {
            string userName = "FakeUserName";
            string passWord = "FakePassWord";
            string staticPass = "", staticUser = "";
            bool correct = false;

            while(staticUser != userName)
            {
                Console.Write("Username:\t");
                staticUser = Console.ReadLine();
                
                if(staticUser == userName)
                {
                    break;
                }

                Console.WriteLine("Incorrect!\n");
            }

            while (staticPass != passWord)
            {
                Console.Write("Password:\t");
                staticPass = Console.ReadLine();

                if (staticPass == passWord)
                {
                    break;
                }

                Console.WriteLine("Incorrect!\n");
            }

            Console.WriteLine("Press Enter...");
            Console.ReadLine();
        }
    }
}
 
Was thinking if you did something like
C#:
String username ;
String password;

If(username =="" || password =="")
{
    Console.Writeln("Username or Password not correct");
 }
else 
 { 
    // do mysql connection
}


Forgive me am coding from mobile.
 
Back
Top Bottom