Esempio n. 1
0
        void btnLogin_Clicked(object sender, EventArgs e)
        {
            LoginResult lr = Login();

            if (lr == null) return;

            if (lr.Passed)
            {
                loginResult = lr;
                Close();
            }
        }
Esempio n. 2
0
        public LoginResult Login(string user, string pass)
        {
            LoginResult toReturn;

            WebClient wc = new WebClient();
            string loginstring = String.Format("{0}?username={1}&password={2}", loginscript, user, Security.HashString(pass));
            Console.WriteLine("Sending to: {0}", loginstring);
            string reply = wc.DownloadString(loginstring);
            if (reply.StartsWith("error"))
            {
                toReturn = new LoginResult(false);
                Console.WriteLine("Login Failed");
            }
            else
            {
                toReturn = new LoginResult(reply, user, pass);
                Console.WriteLine("Received Hash {0}", reply);
            }

            return toReturn;
        }
Esempio n. 3
0
 void btnCancel_Clicked(object sender, EventArgs e)
 {
     loginResult = new LoginResult(false);
     Close();
 }