示例#1
0
        static void Main(string[] args)
        {
            Channel ch = new Channel();

            string token = ch.getToken("*****@*****.**", "password");
            ch.setAuthToken(token);

            string response = ch.getAllBroadcastsChannels().ToString();
            //string token = ch.getToken("*****@*****.**", "password");
            //Console.Write("Token from Website: " + token + "\n");

            //at.setToken(token);
            //at.createCookieInContainer();
            //string txt = at.readTokenFromCookie();
            //Console.Write("Cookie Token: " + txt + "\n");

            Console.Write(response);

            Console.Read();
        }
示例#2
0
        private void loginButton_Click(object sender, EventArgs e)
        {
            Channel ch = new Channel();

            string username = usernameBox.Text.ToString();
            string password = passwordBox.Text.ToString();
            string token = ch.getToken(username, password);

            if (token == "404"|token == "401")
            {
                loginErrorLabel.Visible = true;
            }
            else
            {
                loginErrorLabel.Visible = false;
                TokenStore.addTokenToStore(token);
                MessageBox.Show(TokenStore.getTokenFromStore(), "Token Obtained and Stored");

                LoginForm.ActiveForm.Close();

            }
        }