Beispiel #1
0
 public void toLogin(LoginArgs e)
 {
     if (Login != null)
     {
         Login(this, e);
     }
 }
Beispiel #2
0
        public TaringaApi(string user, string password)
        {
            this.user   = user;
            this.passwd = password;

            request = new HTTPRequests();
            request.onRecieveAsync += (rr, re) =>
            {
                switch (re.type)
                {
                case "login":
                    try
                    {
                        JObject jo     = JObject.Parse(re.response);
                        string  Result = "";

                        switch (jo.SelectToken("status").ToString())
                        {
                        case "0":
                            Result = "Datos incorrectos";
                            break;

                        case "1":
                            Result = "true";
                            string html = request.getRequest("http://www.taringa.net/mi");
                            getKeys(html);
                            getWebSocketPath(html);
                            break;

                        case "2":
                            Result = "Esta cuenta se encuentra suspendida.";
                            break;
                        }
                        LoginArgs e = new LoginArgs();
                        e.Result = Result;

                        toLogin(e);
                    }
                    catch
                    {
                        LoginArgs e = new LoginArgs();
                        e.Result = "false";

                        toLogin(e);
                    }
                    break;

                case "shout":

                    break;
                }
            };
        }