Example #1
0
        public void getLogin(User user)
        {
            bool matched = CreateDB.LoginUser(user.UserName.ToString(), user.PassWord.ToString());

            //If so, login, else error
            if (matched)
            {
                Clients.Caller.confirmLogin(true);
            }
            else
            {
                Clients.Caller.confirmLogin(false);
            }
        }
        //Public for testing, idk if there is a better way to do this
        public static void Main(string[] args)
        {
            // This will *ONLY* bind to localhost, if you want to bind to all addresses
            // use http://*:8080 to bind to all addresses.
            // See http://msdn.microsoft.com/library/system.net.httplistener.aspx
            // for more information.
            CreateDB db = new CreateDB();

            string url = "http://localhost:8080";

            using (WebApp.Start(url))
            {
                Console.WriteLine("Server running on {0}", url);
                Console.ReadLine();
            }
        }
Example #3
0
        public void getSignup(User user)
        {
            //Check to see if there are no users like this
            //Send encrypted user info to the server
            //Login command\
            bool matched = CreateDB.SignUpUser(user.UserName.ToString(), user.PassWord.ToString());

            if (matched)
            {
                Clients.Caller.confirmSignup(true);
            }
            else
            {
                Clients.Caller.confirmSignup(false);
            }
        }