Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I have a problem with logging in to the server www.aukro.cz,
Here I send how Iam trying a sign, I still can not find a solution, my intention is to log on and then bid at auction. Thanks for any advice regarding my problem with best regards, Jan

C#
        string outurl="https://ssl.aukro.cz/enter_login.php";
        string session = "ZjZmOVBXCg4DBVMMVgBaVlMAUgkLV18GUgJSWlVWXFEABAULAVcKBwUHBQgCUQxWVwFVCgNVM2Q5Nw==";
        string global_login_hash = "19d1f857f0f84ab3cccec54ca9dcac707d55b9f7";
        string session_login_hash = "f192efd010b329a84c51cb22d6419623ae778718";
        string url = "YmI4OFxGRBFYTRdPQ0UeABcJSlcaUUo0MjBh";
        string cod = "OGZkZlVlNmJk";
        string version = "A";
        string user_login = "loginname";
        string user_password = "password";
        string commit = "Přihlásit";

        private void Login()
        {
            WebBrowser b = new WebBrowser();
            b.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(b_DocumentCompleted);
            b.Navigate(outurl);
        }
        private void b_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            WebBrowser b = sender as WebBrowser;
            string response = b.DocumentText;

            // unregisters the first event handler
            // adds a second event handler
            b.DocumentCompleted -= new WebBrowserDocumentCompletedEventHandler(b_DocumentCompleted);
            b.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(b_DocumentCompleted2);
string postData = string.Format("session={0}&global_login_hash={1}&session_login_hash={2}&url={3}&cod={4}&version={5}&user_login={6}&user_password={7}&submit_orange={8}", session, global_login_hash, session_login_hash, url, cod,version, user_login, user_password, commit);

            ASCIIEncoding enc = new ASCIIEncoding();

            b.Navigate(url, "", enc.GetBytes(postData), "Content-Type: application/x-www-form-urlencoded\r\n");
        }
        private void b_DocumentCompleted2(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            WebBrowser b = sender as WebBrowser;
            string response = b.DocumentText;

            if (response.Contains(user_login))
            {
                MessageBox.Show("Login Successful");
            }
            else { MessageBox.Show("error!"); }
        }
Posted
Updated 4-Dec-11 14:37pm
v2
Comments
[no name] 4-Dec-11 20:37pm    
EDIT: added "b" tag

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900